<!doctype html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>CentriMo</title>
    <script type="text/javascript">
      //@JSON_VAR data
      var data = {
        "version": "5.0.2",
        "revision": "a40a52a93b6dce029c34699a737ea432925cfe33",
        "release": "Thu Aug 30 14:26:08 2018 -0700",
        "program": "CentriMo",
        "cmd": [
          "centrimo", "-seqlen", "300", "-verbosity", "1", "-oc",
          "meme/meme-chip_TCP7_1/centrimo_out", "-bfile",
          "meme/meme-chip_TCP7_1/background",
          "meme/meme-chip_TCP7_1/TCP7_1.meme.fa",
          "meme/meme-chip_TCP7_1/meme_out/meme.xml",
          "meme/meme-chip_TCP7_1/dreme_out/dreme.xml"
        ],
        "options": {
          "cd": false,
          "neg_sequences": false,
          "xalph": "",
          "bfile": "meme/meme-chip_TCP7_1/background",
          "motif_pseudo": 0.1,
          "seqlen": 300,
          "use_lo_fraction": false,
          "use_pvalues": false,
          "score": 5,
          "optimize_score": false,
          "minbin": 0,
          "maxbin": 0,
          "norc": false,
          "sep": false,
          "flip": false,
          "local": false,
          "ethresh": 10,
          "noseq": false,
          "mcc": false
        },
        "seqlen": 300,
        "tested": 10,
        "alphabet": {
          "name": "DNA",
          "like": "dna",
          "ncore": 4,
          "symbols": [
            {
              "symbol": "A",
              "name": "Adenine",
              "colour": "CC0000",
              "complement": "T"
            }, {
              "symbol": "C",
              "name": "Cytosine",
              "colour": "0000CC",
              "complement": "G"
            }, {
              "symbol": "G",
              "name": "Guanine",
              "colour": "FFB300",
              "complement": "C"
            }, {
              "symbol": "T",
              "aliases": "U",
              "name": "Thymine",
              "colour": "008000",
              "complement": "A"
            }, {
              "symbol": "N",
              "aliases": "X.",
              "name": "Any base",
              "equals": "ACGT"
            }, {
              "symbol": "V",
              "name": "Not T",
              "equals": "ACG"
            }, {
              "symbol": "H",
              "name": "Not G",
              "equals": "ACT"
            }, {
              "symbol": "D",
              "name": "Not C",
              "equals": "AGT"
            }, {
              "symbol": "B",
              "name": "Not A",
              "equals": "CGT"
            }, {
              "symbol": "M",
              "name": "Amino",
              "equals": "AC"
            }, {
              "symbol": "R",
              "name": "Purine",
              "equals": "AG"
            }, {
              "symbol": "W",
              "name": "Weak",
              "equals": "AT"
            }, {
              "symbol": "S",
              "name": "Strong",
              "equals": "CG"
            }, {
              "symbol": "Y",
              "name": "Pyrimidine",
              "equals": "CT"
            }, {
              "symbol": "K",
              "name": "Keto",
              "equals": "GT"
            }
          ]
        },
        "background": [0.2772, 0.2228, 0.2228, 0.2772],
        "sequence_db": {
          "source": "meme/meme-chip_TCP7_1/TCP7_1.meme.fa",
          "count": 3000,
          "skipped": 0
        },
        "motif_dbs": [
          {
            "source": "meme/meme-chip_TCP7_1/meme_out/meme.xml",
            "count": 5
          }, {
            "source": "meme/meme-chip_TCP7_1/dreme_out/dreme.xml",
            "count": 5
          }
        ],
        "sequences": [
          "contig_3:26458-26758", "contig_3:37235-37535",
          "contig_3:49257-49557", "contig_1:168931-169231",
          "contig_3:13917-14217", "contig_1:31799-32099",
          "contig_1:73649-73949", "contig_1:103214-103514",
          "Fvb7:3594816-3595116", "contig_1:46352-46652",
          "contig_1:68919-69219", "contig_1:98171-98471",
          "Fvb2:1955120-1955420", "Fvb6:7232265-7232565",
          "Fvb2:13922435-13922735", "Fvb4:17737325-17737625",
          "Fvb4:13658149-13658449", "contig_1:75345-75645",
          "contig_3:7129-7429", "Fvb4:12108264-12108564",
          "Fvb6:6764947-6765247", "Fvb4:13869606-13869906",
          "Fvb4:16611628-16611928", "Fvb3:36668069-36668369",
          "Fvb1:13390645-13390945", "Fvb4:9754790-9755090",
          "Fvb2:7504857-7505157", "Fvb4:19316643-19316943",
          "Fvb2:6634964-6635264", "Fvb5:17778893-17779193",
          "Fvb4:19032211-19032511", "Fvb1:12827142-12827442",
          "Fvb2:18138378-18138678", "Fvb7:2414453-2414753",
          "Fvb4:12415226-12415526", "Fvb4:27404270-27404570",
          "Fvb4:17775141-17775441", "Fvb6:15919655-15919955",
          "Fvb6:1357628-1357928", "Fvb5:22159871-22160171",
          "Fvb4:13199155-13199455", "Fvb3:16314603-16314903",
          "Fvb1:23214083-23214383", "Fvb1:8024043-8024343",
          "Fvb5:12754866-12755166", "Fvb3:27166813-27167113",
          "Fvb3:25083388-25083688", "Fvb1:17290127-17290427",
          "Fvb1:21673312-21673612", "Fvb4:12959358-12959658",
          "Fvb1:20727471-20727771", "Fvb4:13513758-13514058",
          "Fvb2:2574079-2574379", "Fvb7:3957504-3957804",
          "Fvb4:16313901-16314201", "Fvb3:19415472-19415772",
          "Fvb1:14689928-14690228", "Fvb6:22514141-22514441",
          "Fvb4:24365813-24366113", "Fvb5:9181745-9182045",
          "Fvb7:14555334-14555634", "Fvb5:6280362-6280662",
          "Fvb5:17499590-17499890", "Fvb4:11838456-11838756",
          "Fvb2:16823813-16824113", "Fvb1:6065082-6065382",
          "Fvb4:22823997-22824297", "Fvb4:12106236-12106536",
          "Fvb6:23508292-23508592", "Fvb6:17955366-17955666",
          "Fvb4:18845292-18845592", "Fvb3:24385806-24386106",
          "Fvb3:24349108-24349408", "Fvb3:14996437-14996737",
          "Fvb1:19925976-19926276", "Fvb7:15566859-15567159",
          "Fvb1:466083-466383", "Fvb2:21958057-21958357",
          "Fvb3:816485-816785", "Fvb4:10668478-10668778",
          "Fvb2:7513344-7513644", "Fvb2:256374-256674",
          "Fvb1:9993517-9993817", "Fvb1:15992704-15993004",
          "Fvb6:9916514-9916814", "Fvb3:26421964-26422264",
          "Fvb1:13934303-13934603", "Fvb7:21806787-21807087",
          "Fvb6:14858724-14859024", "Fvb4:27984381-27984681",
          "Fvb4:13641748-13642048", "Fvb2:27336635-27336935",
          "Fvb2:24911430-24911730", "Fvb1:14252044-14252344",
          "Fvb1:10388172-10388472", "Fvb4:9671675-9671975",
          "Fvb1:17653452-17653752", "Fvb4:13977953-13978253",
          "Fvb3:23799648-23799948", "Fvb4:202525-202825",
          "Fvb6:18355167-18355467", "Fvb3:5155723-5156023",
          "Fvb6:12001751-12002051", "Fvb6:22588479-22588779",
          "Fvb5:22443899-22444199", "Fvb5:21425741-21426041",
          "Fvb5:12770560-12770860", "Fvb5:12167071-12167371",
          "Fvb5:11953574-11953874", "Fvb4:7264298-7264598",
          "Fvb4:5780560-5780860", "Fvb4:27317199-27317499",
          "Fvb4:18017107-18017407", "Fvb4:16066051-16066351",
          "Fvb4:11445866-11446166", "Fvb3:494803-495103",
          "Fvb3:35333562-35333862", "Fvb3:29461407-29461707",
          "Fvb3:2832912-2833212", "Fvb2:4565682-4565982",
          "Fvb1:21265465-21265765", "Fvb6:28531768-28532068",
          "Fvb4:10909944-10910244", "Fvb5:4946606-4946906",
          "Fvb5:24907330-24907630", "Fvb4:16339636-16339936",
          "Fvb3:22700029-22700329", "Fvb3:19580588-19580888",
          "Fvb1:23180868-23181168", "Fvb1:16179827-16180127",
          "Fvb6:13055048-13055348", "Fvb3:31437967-31438267",
          "Fvb4:9433734-9434034", "Fvb2:29333498-29333798",
          "Fvb7:11596196-11596496", "Fvb4:19376760-19377060",
          "Fvb4:20778947-20779247", "Fvb5:1579166-1579466",
          "Fvb1:21863338-21863638", "Fvb7:1158897-1159197",
          "Fvb6:8902450-8902750", "Fvb4:16630192-16630492",
          "Fvb4:21026308-21026608", "Fvb4:12886011-12886311",
          "Fvb3:25788860-25789160", "Fvb2:23582573-23582873",
          "Fvb7:859010-859310", "Fvb7:6759770-6760070",
          "Fvb6:24774418-24774718", "Fvb6:23006025-23006325",
          "Fvb6:21849069-21849369", "Fvb4:9241445-9241745",
          "Fvb4:8918716-8919016", "Fvb4:8670527-8670827",
          "Fvb3:463150-463450", "Fvb3:10312755-10313055",
          "Fvb1:2612728-2613028", "Fvb5:23902928-23903228",
          "Fvb4:28521002-28521302", "Fvb1:15528143-15528443",
          "Fvb1:12052874-12053174", "Fvb4:30103918-30104218",
          "Fvb3:21459453-21459753", "Fvb2:147343-147643",
          "Fvb4:12711953-12712253", "Fvb6:9821088-9821388",
          "Fvb5:15586566-15586866", "Fvb3:25976066-25976366",
          "Fvb3:15767081-15767381", "Fvb6:26782988-26783288",
          "Fvb6:24802471-24802771", "Fvb6:11023074-11023374",
          "Fvb5:23650882-23651182", "Fvb4:23653118-23653418",
          "Fvb3:25759243-25759543", "Fvb3:25593084-25593384",
          "Fvb3:24318698-24318998", "Fvb3:21175652-21175952",
          "Fvb3:19470444-19470744", "Fvb2:7511570-7511870",
          "Fvb2:3739580-3739880", "Fvb4:22904727-22905027",
          "Fvb3:32021924-32022224", "Fvb2:6592873-6593173",
          "Fvb3:3731296-3731596", "Fvb4:11246210-11246510",
          "Fvb6:17325032-17325332", "Fvb3:19806445-19806745",
          "Fvb1:23177791-23178091", "Fvb4:32209210-32209510",
          "Fvb3:3757557-3757857", "Fvb1:22492349-22492649",
          "Fvb7:1217754-1218054", "Fvb5:10845732-10846032",
          "Fvb6:13730572-13730872", "Fvb5:874806-875106",
          "Fvb5:22603003-22603303", "Fvb5:14946024-14946324",
          "Fvb4:8709679-8709979", "Fvb4:21266231-21266531",
          "Fvb4:11815521-11815821", "Fvb3:4144522-4144822",
          "Fvb3:34355268-34355568", "Fvb2:8545092-8545392",
          "Fvb2:13534897-13535197", "Fvb1:23508103-23508403",
          "Fvb1:22964330-22964630", "Fvb5:11834052-11834352",
          "Fvb2:20032783-20033083", "Fvb3:5434072-5434372",
          "Fvb3:23498503-23498803", "Fvb1:21928229-21928529",
          "Fvb5:15459958-15460258", "Fvb3:19654410-19654710",
          "Fvb2:7277970-7278270", "Fvb2:22673191-22673491",
          "Fvb2:11110421-11110721", "Fvb1:6718513-6718813",
          "Fvb4:330890-331190", "Fvb6:1290603-1290903",
          "Fvb4:24980108-24980408", "Fvb3:13818561-13818861",
          "Fvb1:20411913-20412213", "Fvb7:1105030-1105330",
          "Fvb7:4190922-4191222", "Fvb7:15104643-15104943",
          "Fvb6:21147570-21147870", "Fvb5:22872612-22872912",
          "Fvb5:11889120-11889420", "Fvb4:29400276-29400576",
          "Fvb4:19854637-19854937", "Fvb4:18937900-18938200",
          "Fvb3:32580077-32580377", "Fvb3:27512987-27513287",
          "Fvb3:25948270-25948570", "Fvb3:1178975-1179275",
          "Fvb2:6568227-6568527", "Fvb1:404027-404327",
          "Fvb7:22335942-22336242", "Fvb7:16968022-16968322",
          "Fvb2:19783905-19784205", "Fvb5:21118483-21118783",
          "Fvb4:18899478-18899778", "Fvb1:6247377-6247677",
          "Fvb5:22146810-22147110", "Fvb4:8623649-8623949",
          "Fvb4:19196968-19197268", "Fvb4:18467949-18468249",
          "Fvb4:23961476-23961776", "Fvb4:13403834-13404134",
          "Fvb4:12768487-12768787", "Fvb2:19527919-19528219",
          "Fvb6:23480260-23480560", "Fvb5:26595221-26595521",
          "Fvb4:7427468-7427768", "Fvb7:8482139-8482439",
          "Fvb7:7953681-7953981", "Fvb7:5248544-5248844",
          "Fvb7:22130149-22130449", "Fvb7:11337356-11337656",
          "Fvb7:10138325-10138625", "Fvb6:23494929-23495229",
          "Fvb4:86766-87066", "Fvb4:18017893-18018193",
          "Fvb4:14664834-14665134", "Fvb4:14016652-14016952",
          "Fvb4:11350038-11350338", "Fvb3:33147809-33148109",
          "Fvb3:31699318-31699618", "Fvb3:13565632-13565932",
          "Fvb2:18084120-18084420", "Fvb1:8978316-8978616",
          "Fvb1:14001822-14002122", "Fvb7:16951865-16952165",
          "Fvb6:312563-312863", "Fvb4:9504068-9504368",
          "Fvb5:15330116-15330416", "Fvb6:16866829-16867129",
          "Fvb3:19554409-19554709", "Fvb2:5506191-5506491",
          "Fvb7:14564053-14564353", "Fvb5:14958439-14958739",
          "Fvb4:13431741-13432041", "Fvb3:31397391-31397691",
          "Fvb3:29893484-29893784", "Fvb3:22369896-22370196",
          "Fvb1:17409394-17409694", "Fvb6:26261467-26261767",
          "Fvb6:9598649-9598949", "Fvb6:38889222-38889522",
          "Fvb6:3621416-3621716", "Fvb5:18316476-18316776",
          "Fvb4:30462768-30463068", "Fvb4:25835111-25835411",
          "Fvb4:13829149-13829449", "Fvb3:4610069-4610369",
          "Fvb3:30359251-30359551", "Fvb3:26137787-26138087",
          "Fvb3:19435639-19435939", "Fvb1:5725683-5725983",
          "Fvb1:4865906-4866206", "Fvb1:21701224-21701524",
          "Fvb1:19552733-19553033", "Fvb4:14067716-14068016",
          "contig_1:104576-104876", "Fvb6:19240652-19240952",
          "Fvb3:30734707-30735007", "Fvb7:3034403-3034703",
          "Fvb4:10636125-10636425", "Fvb5:16690379-16690679",
          "Fvb2:8819938-8820238", "Fvb1:19701673-19701973",
          "Fvb4:19848460-19848760", "Fvb3:3947309-3947609",
          "Fvb2:8121412-8121712", "Fvb6:14441159-14441459",
          "Fvb3:34418062-34418362", "Fvb6:14868936-14869236",
          "Fvb3:38306622-38306922", "Fvb3:23412967-23413267",
          "Fvb2:6933918-6934218", "Fvb6:10890979-10891279",
          "Fvb5:11404285-11404585", "Fvb4:1717486-1717786",
          "Fvb1:4860589-4860889", "Fvb4:10580285-10580585",
          "Fvb6:3346134-3346434", "Fvb6:21660879-21661179",
          "Fvb6:2064155-2064455", "Fvb6:1164319-1164619",
          "Fvb5:29380286-29380586", "Fvb5:21634844-21635144",
          "Fvb4:32750076-32750376", "Fvb4:11274100-11274400",
          "Fvb4:10973087-10973387", "Fvb4:10859612-10859912",
          "Fvb3:26887252-26887552", "Fvb3:18860838-18861138",
          "Fvb3:18573284-18573584", "Fvb3:15630230-15630530",
          "Fvb2:9796015-9796315", "Fvb2:28480325-28480625",
          "Fvb2:16196157-16196457", "Fvb1:22910253-22910553",
          "Fvb1:22285376-22285676", "Fvb4:11764619-11764919",
          "Fvb3:5302186-5302486", "Fvb6:23705603-23705903",
          "Fvb6:15157507-15157807", "Fvb2:16312422-16312722",
          "Fvb4:11499276-11499576", "Fvb7:2800250-2800550",
          "Fvb5:18699876-18700176", "Fvb4:9595132-9595432",
          "Fvb4:8936108-8936408", "Fvb5:11211928-11212228",
          "Fvb2:26867744-26868044", "Fvb3:22270364-22270664",
          "Fvb4:8474205-8474505", "Fvb3:19357353-19357653",
          "Fvb1:22746974-22747274", "Fvb1:16662391-16662691",
          "Fvb3:16719933-16720233", "Fvb5:7777835-7778135",
          "Fvb4:9190675-9190975", "Fvb2:26870189-26870489",
          "Fvb2:13232862-13233162", "Fvb5:2325580-2325880",
          "Fvb5:20566604-20566904", "Fvb7:947653-947953",
          "Fvb7:12841121-12841421", "Fvb6:7068910-7069210",
          "Fvb6:5672139-5672439", "Fvb6:25278074-25278374",
          "Fvb5:2623144-2623444", "Fvb5:13357168-13357468",
          "Fvb5:12426315-12426615", "Fvb4:4451171-4451471",
          "Fvb4:19701982-19702282", "Fvb4:16539078-16539378",
          "Fvb4:12692679-12692979", "Fvb4:12185468-12185768",
          "Fvb3:20081126-20081426", "Fvb3:18344145-18344445",
          "Fvb3:16161357-16161657", "Fvb3:15669272-15669572",
          "Fvb2:15680028-15680328", "Fvb1:8306018-8306318",
          "Fvb1:8232528-8232828", "Fvb1:5033493-5033793",
          "Fvb3:26208782-26209082", "Fvb2:6530276-6530576",
          "Fvb3:21488554-21488854", "Fvb7:5083178-5083478",
          "Fvb6:27187999-27188299", "Fvb3:28133767-28134067",
          "Fvb2:25648794-25649094", "Fvb6:36321883-36322183",
          "Fvb5:13744894-13745194", "Fvb4:21334657-21334957",
          "Fvb6:31555951-31556251", "Fvb6:12163667-12163967",
          "Fvb1:956877-957177", "Fvb7:2343470-2343770", "Fvb6:969275-969575",
          "Fvb6:33977202-33977502", "Fvb5:26523718-26524018",
          "Fvb4:9757000-9757300", "Fvb2:21278697-21278997",
          "Fvb1:14272094-14272394", "Fvb5:12627319-12627619",
          "Fvb7:7650355-7650655", "Fvb2:7567506-7567806",
          "Fvb3:24090534-24090834", "Fvb1:22486502-22486802",
          "Fvb7:833341-833641", "Fvb7:5500412-5500712",
          "Fvb7:3850460-3850760", "Fvb7:10276188-10276488",
          "Fvb6:37915410-37915710", "Fvb6:24853397-24853697",
          "Fvb6:10948470-10948770", "Fvb5:28856456-28856756",
          "Fvb4:9361723-9362023", "Fvb4:30731666-30731966",
          "Fvb4:20027181-20027481", "Fvb4:19593625-19593925",
          "Fvb4:17709648-17709948", "Fvb4:13773278-13773578",
          "Fvb4:12275930-12276230", "Fvb3:31672619-31672919",
          "Fvb3:31589471-31589771", "Fvb3:26431192-26431492",
          "Fvb3:23034974-23035274", "Fvb3:22133023-22133323",
          "Fvb2:18331473-18331773", "Fvb2:14574070-14574370",
          "Fvb2:10260112-10260412", "Fvb2:787814-788114",
          "Fvb4:9772243-9772543", "Fvb4:11610950-11611250",
          "Fvb4:12718321-12718621", "Fvb6:9445125-9445425",
          "Fvb7:3305582-3305882", "Fvb3:5146790-5147090",
          "Fvb5:26221194-26221494", "Fvb4:13210148-13210448",
          "Fvb2:13330718-13331018", "Fvb3:15906645-15906945",
          "Fvb3:25618081-25618381", "Fvb6:9225777-9226077",
          "Fvb4:24725475-24725775", "Fvb3:24962416-24962716",
          "Fvb3:13178756-13179056", "Fvb2:9266076-9266376",
          "Fvb2:11696395-11696695", "Fvb4:33439144-33439444",
          "Fvb4:12630794-12631094", "Fvb7:22450915-22451215",
          "Fvb1:12384251-12384551", "Fvb1:14593324-14593624",
          "Fvb6:37638401-37638701", "Fvb3:15396969-15397269",
          "Fvb7:20452209-20452509", "Fvb7:9156108-9156408",
          "Fvb6:4056881-4057181", "Fvb6:32589186-32589486",
          "Fvb6:20680594-20680894", "Fvb5:22301118-22301418",
          "Fvb5:21563316-21563616", "Fvb4:8468428-8468728",
          "Fvb4:31099911-31100211", "Fvb4:23472380-23472680",
          "Fvb4:23055819-23056119", "Fvb4:14026035-14026335",
          "Fvb4:14021806-14022106", "Fvb4:13311069-13311369",
          "Fvb3:9056055-9056355", "Fvb3:2815274-2815574",
          "Fvb3:27512149-27512449", "Fvb3:12832897-12833197",
          "Fvb2:27208535-27208835", "Fvb2:22469560-22469860",
          "Fvb2:12329098-12329398", "Fvb1:19831875-19832175",
          "Fvb1:13197109-13197409", "Fvb6:21163746-21164046",
          "Fvb4:140840-141140", "Fvb4:18812698-18812998",
          "Fvb3:5330359-5330659", "Fvb3:26926390-26926690",
          "contig_1:12360-12660", "Fvb6:16918815-16919115",
          "Fvb6:24719894-24720194", "Fvb5:15092051-15092351",
          "Fvb6:7742509-7742809", "Fvb4:21514997-21515297",
          "Fvb2:17460539-17460839", "Fvb6:982034-982334",
          "Fvb6:21895600-21895900", "Fvb5:20211647-20211947",
          "Fvb4:19422358-19422658", "Fvb5:14523908-14524208",
          "Fvb3:32207644-32207944", "Fvb5:28262453-28262753",
          "Fvb2:26894376-26894676", "Fvb1:10429619-10429919",
          "Fvb7:7043561-7043861", "Fvb7:2427504-2427804",
          "Fvb3:28395809-28396109", "Fvb3:17465892-17466192",
          "Fvb1:12771298-12771598", "Fvb5:15443120-15443420",
          "Fvb5:12212160-12212460", "Fvb3:1136721-1137021",
          "Fvb4:13483419-13483719", "Fvb7:15392067-15392367",
          "Fvb4:95415-95715", "Fvb3:19662533-19662833",
          "Fvb3:15889480-15889780", "Fvb1:23058194-23058494",
          "Fvb7:9021341-9021641", "Fvb6:32984351-32984651",
          "Fvb6:31506345-31506645", "Fvb6:12777795-12778095",
          "Fvb5:2541508-2541808", "Fvb5:15236425-15236725",
          "Fvb4:23502520-23502820", "Fvb4:20103301-20103601",
          "Fvb4:12434511-12434811", "Fvb4:11595347-11595647",
          "Fvb3:35669713-35670013", "Fvb3:34404420-34404720",
          "Fvb3:26665361-26665661", "Fvb3:25888402-25888702",
          "Fvb3:21405488-21405788", "Fvb2:14544302-14544602",
          "Fvb2:13557608-13557908", "Fvb1:3992026-3992326",
          "Fvb1:3969617-3969917", "Fvb1:22934445-22934745",
          "Fvb1:22013911-22014211", "Fvb1:20014838-20015138",
          "Fvb2:3115085-3115385", "Fvb4:13093732-13094032",
          "Fvb3:14232838-14233138", "Fvb5:12587086-12587386",
          "Fvb4:6506946-6507246", "Fvb4:31208611-31208911",
          "Fvb4:18567075-18567375", "Fvb3:7590904-7591204",
          "Fvb1:11062901-11063201", "Fvb3:2657382-2657682",
          "Fvb7:14240345-14240645", "Fvb4:13437039-13437339",
          "Fvb1:15132230-15132530", "Fvb5:7461254-7461554",
          "Fvb4:14575821-14576121", "Fvb4:6063275-6063575",
          "Fvb4:13264504-13264804", "Fvb3:22838846-22839146",
          "Fvb3:26747751-26748051", "Fvb2:3943783-3944083",
          "Fvb2:14108053-14108353", "Fvb1:5199029-5199329",
          "Fvb1:23501742-23502042", "Fvb4:18818493-18818793",
          "Fvb6:33070750-33071050", "Fvb6:13029254-13029554",
          "Fvb4:19937065-19937365", "Fvb4:15762259-15762559",
          "Fvb4:12638210-12638510", "Fvb3:14926390-14926690",
          "Fvb5:7415458-7415758", "Fvb5:1571477-1571777",
          "Fvb4:21398438-21398738", "Fvb2:25890623-25890923",
          "Fvb7:17922785-17923085", "Fvb3:27953331-27953631",
          "Fvb3:35644870-35645170", "Fvb7:4402219-4402519",
          "Fvb5:22716735-22717035", "Fvb4:10229106-10229406",
          "Fvb2:5282369-5282669", "Fvb7:5919203-5919503",
          "Fvb7:2468657-2468957", "Fvb6:35108458-35108758",
          "Fvb6:34606278-34606578", "Fvb6:30336456-30336756",
          "Fvb6:18518850-18519150", "Fvb6:12963425-12963725",
          "Fvb5:3054906-3055206", "Fvb5:23987031-23987331",
          "Fvb5:18533439-18533739", "Fvb5:13444243-13444543",
          "Fvb4:9192553-9192853", "Fvb4:6924650-6924950",
          "Fvb4:4772816-4773116", "Fvb4:20460019-20460319",
          "Fvb4:19158687-19158987", "Fvb4:13678076-13678376",
          "Fvb4:13569782-13570082", "Fvb4:10280045-10280345",
          "Fvb3:32890443-32890743", "Fvb3:24572493-24572793",
          "Fvb3:22664081-22664381", "Fvb3:21503933-21504233",
          "Fvb3:19404984-19405284", "Fvb2:2091394-2091694",
          "Fvb2:17316532-17316832", "Fvb2:16554857-16555157",
          "Fvb2:15529738-15530038", "Fvb1:20482130-20482430",
          "Fvb1:19619243-19619543", "Fvb5:8143160-8143460",
          "Fvb6:38105174-38105474", "Fvb5:10785499-10785799",
          "Fvb4:8954642-8954942", "Fvb3:14087853-14088153",
          "Fvb5:12990306-12990606", "Fvb6:32644109-32644409",
          "Fvb2:18593996-18594296", "Fvb3:25341361-25341661",
          "Fvb6:35642777-35643077", "Fvb4:10898995-10899295",
          "Fvb1:9876234-9876534", "Fvb5:15883119-15883419",
          "Fvb1:2508726-2509026", "Fvb4:25070999-25071299",
          "Fvb1:4687617-4687917", "Fvb7:4891416-4891716",
          "Fvb7:4099205-4099505", "Fvb5:16530786-16531086",
          "Fvb4:8696854-8697154", "Fvb4:3569107-3569407",
          "Fvb4:13108322-13108622", "Fvb2:13521973-13522273",
          "Fvb5:15083496-15083796", "Fvb3:8167401-8167701",
          "Fvb2:6800606-6800906", "Fvb1:12934090-12934390",
          "Fvb5:26166451-26166751", "Fvb4:7262366-7262666",
          "Fvb4:30330455-30330755", "Fvb4:12298999-12299299",
          "Fvb3:29477182-29477482", "Fvb3:16423836-16424136",
          "Fvb7:11336194-11336494", "Fvb3:7827840-7828140",
          "Fvb3:25551006-25551306", "Fvb4:16363542-16363842",
          "Fvb3:1309922-1310222", "Fvb3:2443498-2443798",
          "Fvb5:4895890-4896190", "Fvb1:16423644-16423944",
          "Fvb6:20008168-20008468", "Fvb5:28722210-28722510",
          "Fvb6:19640885-19641185", "Fvb4:7211625-7211925",
          "Fvb3:37547701-37548001", "Fvb3:30044080-30044380",
          "Fvb2:7016355-7016655", "Fvb2:21964428-21964728",
          "Fvb4:7624661-7624961", "Fvb7:8539928-8540228",
          "Fvb7:6805903-6806203", "Fvb6:6009101-6009401",
          "Fvb6:28490784-28491084", "Fvb6:21788521-21788821",
          "Fvb6:21463365-21463665", "Fvb6:18346103-18346403",
          "Fvb6:14819356-14819656", "Fvb5:27187564-27187864",
          "Fvb5:26801392-26801692", "Fvb5:22629798-22630098",
          "Fvb5:14632875-14633175", "Fvb5:12664007-12664307",
          "Fvb4:8662806-8663106", "Fvb4:7499269-7499569",
          "Fvb4:30321140-30321440", "Fvb4:29884870-29885170",
          "Fvb4:26257793-26258093", "Fvb4:25967516-25967816",
          "Fvb4:2366479-2366779", "Fvb4:18949939-18950239",
          "Fvb4:17400450-17400750", "Fvb4:11452853-11453153",
          "Fvb4:10691051-10691351", "Fvb4:10003936-10004236",
          "Fvb3:25787388-25787688", "Fvb3:25297937-25298237",
          "Fvb3:14638484-14638784", "Fvb3:12801365-12801665",
          "Fvb2:6587610-6587910", "Fvb2:28851857-28852157",
          "Fvb2:1147567-1147867", "Fvb1:19160092-19160392",
          "Fvb3:8776825-8777125", "Fvb3:16382337-16382637",
          "Fvb5:20683998-20684298", "Fvb6:23500118-23500418",
          "Fvb2:21145533-21145833", "Fvb1:4816910-4817210",
          "Fvb1:23006022-23006322", "Fvb4:32050816-32051116",
          "Fvb4:8398468-8398768", "Fvb2:19516036-19516336",
          "Fvb4:27579756-27580056", "Fvb7:19828783-19829083",
          "Fvb6:34289811-34290111", "Fvb5:18708468-18708768",
          "Fvb4:639165-639465", "Fvb4:19244315-19244615",
          "Fvb3:18427100-18427400", "Fvb6:31568733-31569033",
          "Fvb5:5662200-5662500", "Fvb5:22999029-22999329",
          "Fvb4:13268352-13268652", "Fvb4:13189195-13189495",
          "Fvb3:27013015-27013315", "Fvb4:12681981-12682281",
          "Fvb7:8541482-8541782", "Fvb6:21091247-21091547",
          "Fvb4:6133937-6134237", "Fvb4:10110803-10111103",
          "Fvb3:25510443-25510743", "Fvb2:19093584-19093884",
          "Fvb6:19955523-19955823", "Fvb5:18985536-18985836",
          "Fvb3:24059348-24059648", "Fvb5:23088324-23088624",
          "Fvb4:6027146-6027446", "Fvb5:24818834-24819134",
          "Fvb2:18155009-18155309", "Fvb7:9261377-9261677",
          "Fvb7:8027972-8028272", "Fvb7:667276-667576",
          "Fvb7:22429280-22429580", "Fvb6:6035082-6035382",
          "Fvb6:5416128-5416428", "Fvb6:31010958-31011258",
          "Fvb6:29406553-29406853", "Fvb6:26580975-26581275",
          "Fvb6:16809273-16809573", "Fvb6:16656519-16656819",
          "Fvb6:13972386-13972686", "Fvb5:583008-583308",
          "Fvb5:25618993-25619293", "Fvb5:23050187-23050487",
          "Fvb5:22737309-22737609", "Fvb5:22655170-22655470",
          "Fvb5:18961028-18961328", "Fvb5:18867897-18868197",
          "Fvb5:14314413-14314713", "Fvb4:8908978-8909278",
          "Fvb4:32080411-32080711", "Fvb4:24743761-24744061",
          "Fvb4:19703230-19703530", "Fvb4:13891224-13891524",
          "Fvb4:13799137-13799437", "Fvb4:13512031-13512331",
          "Fvb3:3364624-3364924", "Fvb3:26353068-26353368",
          "Fvb3:2256050-2256350", "Fvb3:19702885-19703185",
          "Fvb3:19397978-19398278", "Fvb3:19316469-19316769",
          "Fvb3:18630404-18630704", "Fvb3:1842335-1842635",
          "Fvb3:16641095-16641395", "Fvb3:16496452-16496752",
          "Fvb2:9455509-9455809", "Fvb2:7647153-7647453",
          "Fvb2:7183112-7183412", "Fvb2:6176017-6176317",
          "Fvb2:4364417-4364717", "Fvb2:27273419-27273719",
          "Fvb2:25029517-25029817", "Fvb2:21811538-21811838",
          "Fvb2:18869906-18870206", "Fvb2:15711374-15711674",
          "Fvb1:3376425-3376725", "Fvb1:20636797-20637097",
          "Fvb1:20452753-20453053", "Fvb1:19975142-19975442",
          "Fvb1:1039863-1040163", "Fvb6:3557400-3557700",
          "Fvb6:28366816-28367116", "Fvb3:3069976-3070276",
          "Fvb1:23046563-23046863", "Fvb3:19708075-19708375",
          "Fvb3:8291590-8291890", "Fvb6:3625366-3625666",
          "Fvb6:688306-688606", "Fvb6:29850585-29850885",
          "Fvb5:14908582-14908882", "Fvb2:20529641-20529941",
          "Fvb1:22445395-22445695", "Fvb4:18051344-18051644",
          "Fvb4:14669255-14669555", "Fvb4:12283077-12283377",
          "Fvb3:22312582-22312882", "Fvb3:18580273-18580573",
          "Fvb7:7232763-7233063", "Fvb5:25337926-25338226",
          "Fvb5:22393577-22393877", "Fvb4:9593937-9594237",
          "Fvb4:8728389-8728689", "Fvb4:13451732-13452032",
          "Fvb3:8324185-8324485", "Fvb3:3938369-3938669",
          "Fvb1:22461783-22462083", "Fvb1:16720289-16720589",
          "Fvb1:10990213-10990513", "Fvb6:35637610-35637910",
          "Fvb2:17202180-17202480", "Fvb6:28493216-28493516",
          "Fvb4:8091496-8091796", "Fvb7:13461973-13462273",
          "Fvb6:12869155-12869455", "Fvb4:12308081-12308381",
          "Fvb3:30736762-30737062", "Fvb1:19666130-19666430",
          "Fvb6:26290733-26291033", "Fvb3:16384138-16384438",
          "Fvb2:9086833-9087133", "Fvb2:1350971-1351271",
          "Fvb4:28913747-28914047", "Fvb5:2817784-2818084",
          "Fvb4:10336451-10336751", "Fvb4:12056210-12056510",
          "Fvb7:3780982-3781282", "Fvb3:27312299-27312599",
          "Fvb3:16458919-16459219", "Fvb2:21625389-21625689",
          "Fvb2:18463446-18463746", "Fvb7:10983413-10983713",
          "Fvb6:2763536-2763836", "Fvb6:25333993-25334293",
          "Fvb6:24865962-24866262", "Fvb6:22415760-22416060",
          "Fvb6:20145856-20146156", "Fvb6:17462128-17462428",
          "Fvb5:8148390-8148690", "Fvb5:21352577-21352877",
          "Fvb5:19385391-19385691", "Fvb5:1128464-1128764",
          "Fvb4:9760026-9760326", "Fvb4:9531627-9531927",
          "Fvb4:8525546-8525846", "Fvb4:31646794-31647094",
          "Fvb4:31351899-31352199", "Fvb4:3103733-3104033",
          "Fvb4:20041113-20041413", "Fvb4:15413159-15413459",
          "Fvb4:13484300-13484600", "Fvb4:13024888-13025188",
          "Fvb3:7756547-7756847", "Fvb3:4786037-4786337",
          "Fvb3:35599857-35600157", "Fvb3:34374316-34374616",
          "Fvb3:32417738-32418038", "Fvb3:29331265-29331565",
          "Fvb3:28978242-28978542", "Fvb3:28308908-28309208",
          "Fvb3:26341568-26341868", "Fvb3:18924372-18924672",
          "Fvb3:18858279-18858579", "Fvb3:10313429-10313729",
          "Fvb2:9364642-9364942", "Fvb2:8870592-8870892",
          "Fvb2:8042630-8042930", "Fvb2:671283-671583",
          "Fvb2:28649408-28649708", "Fvb2:23914810-23915110",
          "Fvb2:15768092-15768392", "Fvb1:816922-817222",
          "Fvb1:5512853-5513153", "Fvb1:4637994-4638294",
          "Fvb1:2759248-2759548", "Fvb1:23032392-23032692",
          "Fvb1:21704124-21704424", "Fvb1:20505305-20505605",
          "Fvb1:10309767-10310067", "Fvb3:2602905-2603205",
          "Fvb1:13173536-13173836", "Fvb4:4172897-4173197",
          "Fvb4:9607640-9607940", "Fvb6:9411177-9411477",
          "Fvb6:13736108-13736408", "Fvb3:26636411-26636711",
          "Fvb4:7554043-7554343", "Fvb3:4725648-4725948",
          "Fvb3:34241079-34241379", "Fvb3:13548425-13548725",
          "Fvb2:1290027-1290327", "Fvb6:2979675-2979975",
          "Fvb3:16209538-16209838", "Fvb7:5499369-5499669",
          "Fvb6:3772235-3772535", "Fvb6:17304282-17304582",
          "Fvb6:17292124-17292424", "Fvb6:122074-122374",
          "Fvb4:10303571-10303871", "Fvb3:9853487-9853787",
          "Fvb4:8690946-8691246", "Fvb1:907230-907530",
          "Fvb6:17297222-17297522", "Fvb4:28043665-28043965",
          "Fvb3:8996509-8996809", "Fvb2:28069978-28070278",
          "Fvb2:24737907-24738207", "Fvb1:21652938-21653238",
          "Fvb1:19161281-19161581", "Fvb7:23217721-23218021",
          "Fvb7:4108555-4108855", "Fvb7:12174193-12174493",
          "Fvb5:17653474-17653774", "Fvb4:19372513-19372813",
          "Fvb1:23289682-23289982", "Fvb6:29802681-29802981",
          "Fvb4:12960786-12961086", "Fvb4:1894437-1894737",
          "Fvb3:26132032-26132332", "Fvb6:15159939-15160239",
          "Fvb1:17782992-17783292", "Fvb4:9734684-9734984",
          "Fvb4:22428612-22428912", "Fvb3:25371446-25371746",
          "Fvb2:22093683-22093983", "Fvb2:12762872-12763172",
          "Fvb3:10878861-10879161", "Fvb4:13820085-13820385",
          "Fvb7:2990159-2990459", "Fvb7:16942872-16943172",
          "Fvb7:13364596-13364896", "Fvb7:12419215-12419515",
          "Fvb6:32684894-32685194", "Fvb6:26424195-26424495",
          "Fvb6:16971730-16972030", "Fvb6:1151144-1151444",
          "Fvb5:7917501-7917801", "Fvb5:6802946-6803246",
          "Fvb5:25682832-25683132", "Fvb5:22589916-22590216",
          "Fvb5:15750413-15750713", "Fvb4:8922261-8922561",
          "Fvb4:4190230-4190530", "Fvb4:29020688-29020988",
          "Fvb4:23969235-23969535", "Fvb4:21981108-21981408",
          "Fvb4:19829063-19829363", "Fvb4:19187296-19187596",
          "Fvb4:15498638-15498938", "Fvb4:13313566-13313866",
          "Fvb3:29102228-29102528", "Fvb3:26185661-26185961",
          "Fvb3:23115452-23115752", "Fvb3:23004753-23005053",
          "Fvb3:14328831-14329131", "Fvb2:5809161-5809461",
          "Fvb2:23629039-23629339", "Fvb2:23264374-23264674",
          "Fvb1:23415933-23416233", "Fvb1:23246394-23246694",
          "Fvb1:22622746-22623046", "Fvb1:20312223-20312523",
          "Fvb1:19768514-19768814", "Fvb1:16113723-16114023",
          "Fvb1:15380048-15380348", "contig_1:3058-3358",
          "Fvb1:23301237-23301537", "Fvb7:24062399-24062699",
          "Fvb4:15439897-15440197", "Fvb6:17783857-17784157",
          "Fvb4:8434286-8434586", "Fvb2:21914539-21914839",
          "Fvb7:13718439-13718739", "Fvb1:5475164-5475464",
          "Fvb7:11347333-11347633", "Fvb3:26007288-26007588",
          "Fvb1:23516353-23516653", "Fvb4:11692090-11692390",
          "Fvb3:7558512-7558812", "Fvb4:10629922-10630222",
          "Fvb3:26580643-26580943", "Fvb3:24105139-24105439",
          "Fvb2:7401714-7402014", "Fvb6:35935410-35935710",
          "Fvb2:27455422-27455722", "Fvb7:10310014-10310314",
          "Fvb6:4262247-4262547", "Fvb5:27660436-27660736",
          "Fvb5:16333842-16334142", "Fvb2:4091816-4092116",
          "Fvb7:1614802-1615102", "Fvb1:20060837-20061137",
          "Fvb2:11422317-11422617", "Fvb6:25091678-25091978",
          "Fvb2:27365034-27365334", "Fvb7:850064-850364",
          "Fvb6:16594802-16595102", "Fvb6:10760268-10760568",
          "Fvb4:27440578-27440878", "Fvb4:26291358-26291658",
          "Fvb4:13858149-13858449", "Fvb1:17853146-17853446",
          "Fvb3:8795075-8795375", "Fvb4:10031396-10031696",
          "Fvb6:1833415-1833715", "Fvb6:19914134-19914434",
          "Fvb7:3842795-3843095", "Fvb7:3692869-3693169",
          "Fvb7:2305991-2306291", "Fvb7:20987721-20988021",
          "Fvb7:19313859-19314159", "Fvb7:16363504-16363804",
          "Fvb6:39008494-39008794", "Fvb6:23484400-23484700",
          "Fvb6:20214611-20214911", "Fvb6:17408019-17408319",
          "Fvb6:14509373-14509673", "Fvb5:23426758-23427058",
          "Fvb5:21442994-21443294", "Fvb5:18130978-18131278",
          "Fvb5:16429108-16429408", "Fvb4:9683917-9684217",
          "Fvb4:8892111-8892411", "Fvb4:7981092-7981392",
          "Fvb4:7971032-7971332", "Fvb4:6958796-6959096",
          "Fvb4:6196092-6196392", "Fvb4:30851664-30851964",
          "Fvb4:23146606-23146906", "Fvb4:22803357-22803657",
          "Fvb4:15959047-15959347", "Fvb4:14659444-14659744",
          "Fvb4:12932325-12932625", "Fvb4:10437954-10438254",
          "Fvb4:10272384-10272684", "Fvb3:37248743-37249043",
          "Fvb3:34336005-34336305", "Fvb3:30805818-30806118",
          "Fvb3:26043664-26043964", "Fvb3:24996310-24996610",
          "Fvb3:24857016-24857316", "Fvb3:23976765-23977065",
          "Fvb3:19619187-19619487", "Fvb3:18921081-18921381",
          "Fvb2:4811466-4811766", "Fvb2:21333801-21334101",
          "Fvb2:17803644-17803944", "Fvb2:14655374-14655674",
          "Fvb2:14536357-14536657", "Fvb2:14125465-14125765",
          "Fvb2:11194134-11194434", "Fvb2:10311190-10311490",
          "Fvb1:8778776-8779076", "Fvb1:3602867-3603167",
          "Fvb1:23168908-23169208", "Fvb1:21110965-21111265",
          "Fvb1:19216717-19217017", "Fvb1:13143357-13143657",
          "Fvb1:22510026-22510326", "Fvb6:18637776-18638076",
          "Fvb4:9898175-9898475", "Fvb3:33816335-33816635",
          "Fvb1:4795107-4795407", "Fvb1:10167188-10167488",
          "Fvb7:821459-821759", "Fvb4:19647519-19647819",
          "Fvb3:4473175-4473475", "contig_1:80517-80817",
          "Fvb5:17094203-17094503", "Fvb4:11016615-11016915",
          "Fvb7:829793-830093", "Fvb1:16091187-16091487",
          "Fvb3:33540734-33541034", "Fvb7:20195544-20195844",
          "Fvb4:10433916-10434216", "Fvb3:10987424-10987724",
          "Fvb1:20261747-20262047", "Fvb1:16182476-16182776",
          "Fvb3:27324101-27324401", "Fvb2:10453534-10453834",
          "Fvb5:15889195-15889495", "Fvb1:19608557-19608857",
          "Fvb4:10638809-10639109", "Fvb5:21236963-21237263",
          "Fvb6:18352560-18352860", "Fvb4:14104234-14104534",
          "Fvb4:12416451-12416751", "Fvb3:3667381-3667681",
          "Fvb3:19442806-19443106", "Fvb3:13837067-13837367",
          "Fvb5:17285483-17285783", "Fvb3:5378419-5378719",
          "Fvb5:2268335-2268635", "Fvb6:22319224-22319524",
          "Fvb5:21342523-21342823", "Fvb6:21488143-21488443",
          "Fvb5:17451534-17451834", "Fvb7:18949930-18950230",
          "Fvb5:725668-725968", "Fvb3:31628011-31628311",
          "Fvb5:15938563-15938863", "Fvb3:2890620-2890920",
          "Fvb7:5218186-5218486", "Fvb7:21129644-21129944",
          "Fvb7:11344896-11345196", "Fvb6:23170638-23170938",
          "Fvb6:22315780-22316080", "Fvb6:19334600-19334900",
          "Fvb6:11081494-11081794", "Fvb5:7532647-7532947",
          "Fvb5:16216875-16217175", "Fvb5:15140959-15141259",
          "Fvb4:7967395-7967695", "Fvb4:3554042-3554342",
          "Fvb4:30700760-30701060", "Fvb4:25603332-25603632",
          "Fvb4:23683131-23683431", "Fvb4:19069950-19070250",
          "Fvb4:13270883-13271183", "Fvb4:12702447-12702747",
          "Fvb4:12667169-12667469", "Fvb4:12394475-12394775",
          "Fvb3:9377176-9377476", "Fvb3:8571617-8571917",
          "Fvb3:8347046-8347346", "Fvb3:35522596-35522896",
          "Fvb3:35497025-35497325", "Fvb3:33007975-33008275",
          "Fvb3:28001989-28002289", "Fvb3:26023400-26023700",
          "Fvb3:10632977-10633277", "Fvb2:795832-796132",
          "Fvb2:18779374-18779674", "Fvb2:1749621-1749921",
          "Fvb2:14064620-14064920", "Fvb1:20541226-20541526",
          "Fvb1:20325317-20325617", "Fvb1:15025737-15026037",
          "Fvb1:13884577-13884877", "Fvb1:12191631-12191931",
          "Fvb1:10767562-10767862", "Fvb4:15106688-15106988",
          "Fvb7:17404841-17405141", "Fvb6:19298167-19298467",
          "Fvb2:23544212-23544512", "Fvb1:23522680-23522980",
          "Fvb7:22952623-22952923", "Fvb4:13150107-13150407",
          "Fvb1:20319130-20319430", "Fvb4:116723-117023",
          "Fvb3:3573812-3574112", "Fvb2:5277542-5277842",
          "Fvb2:25261502-25261802", "Fvb1:872214-872514",
          "Fvb2:14088712-14089012", "Fvb6:25661785-25662085",
          "Fvb4:31153808-31154108", "Fvb4:10331537-10331837",
          "Fvb3:26785609-26785909", "Fvb1:8698074-8698374",
          "Fvb1:23408497-23408797", "Fvb1:1348381-1348681",
          "Fvb2:20635870-20636170", "Fvb6:15614036-15614336",
          "Fvb6:13974819-13975119", "Fvb5:4330050-4330350",
          "Fvb4:13121911-13122211", "Fvb6:12557442-12557742",
          "Fvb4:18578639-18578939", "Fvb3:12881455-12881755",
          "Fvb2:14092298-14092598", "Fvb1:21524995-21525295",
          "Fvb1:19582242-19582542", "Fvb4:29866386-29866686",
          "Fvb4:11264921-11265221", "Fvb1:1066753-1067053",
          "Fvb1:6085565-6085865", "Fvb5:11583029-11583329",
          "Fvb5:20940734-20941034", "Fvb3:7639208-7639508",
          "Fvb2:10825089-10825389", "Fvb1:4408779-4409079",
          "Fvb1:21923870-21924170", "Fvb4:8600923-8601223",
          "Fvb4:13855408-13855708", "Fvb2:25891821-25892121",
          "Fvb5:28115740-28116040", "Fvb4:11729081-11729381",
          "Fvb7:3569868-3570168", "Fvb4:13062877-13063177",
          "Fvb6:18509989-18510289", "Fvb1:2254396-2254696",
          "Fvb7:19072491-19072791", "Fvb7:5352485-5352785",
          "Fvb5:7510427-7510727", "Fvb7:3244027-3244327",
          "Fvb7:17873644-17873944", "Fvb6:6365451-6365751",
          "Fvb6:31127170-31127470", "Fvb6:29908985-29909285",
          "Fvb6:28849343-28849643", "Fvb6:26185230-26185530",
          "Fvb6:22940551-22940851", "Fvb6:21608771-21609071",
          "Fvb6:17194277-17194577", "Fvb6:14734134-14734434",
          "Fvb6:1261122-1261422", "Fvb6:10465195-10465495",
          "Fvb5:8758840-8759140", "Fvb5:7558361-7558661",
          "Fvb5:28233415-28233715", "Fvb5:28200042-28200342",
          "Fvb5:26314676-26314976", "Fvb5:23380135-23380435",
          "Fvb5:20911629-20911929", "Fvb5:20087840-20088140",
          "Fvb5:19446726-19447026", "Fvb5:17820983-17821283",
          "Fvb5:15372883-15373183", "Fvb5:15013076-15013376",
          "Fvb4:804142-804442", "Fvb4:5244092-5244392",
          "Fvb4:20001825-20002125", "Fvb4:16847503-16847803",
          "Fvb4:15556943-15557243", "Fvb4:14300851-14301151",
          "Fvb4:14290763-14291063", "Fvb4:13872899-13873199",
          "Fvb4:13845743-13846043", "Fvb4:13752308-13752608",
          "Fvb4:13563144-13563444", "Fvb4:10714405-10714705",
          "Fvb4:10701280-10701580", "Fvb4:10470464-10470764",
          "Fvb3:6734950-6735250", "Fvb3:29175228-29175528",
          "Fvb3:29063552-29063852", "Fvb3:27895089-27895389",
          "Fvb3:27360228-27360528", "Fvb3:27250297-27250597",
          "Fvb3:26321308-26321608", "Fvb3:25935880-25936180",
          "Fvb3:25191162-25191462", "Fvb3:23922318-23922618",
          "Fvb3:22796656-22796956", "Fvb3:2254240-2254540",
          "Fvb3:2201659-2201959", "Fvb2:5758846-5759146",
          "Fvb2:2092915-2093215", "Fvb2:1354777-1355077",
          "Fvb2:1347497-1347797", "Fvb2:12861394-12861694",
          "Fvb2:11149712-11150012", "Fvb1:7347396-7347696",
          "Fvb1:19872159-19872459", "Fvb1:17423859-17424159",
          "Fvb1:15729810-15730110", "Fvb1:12595481-12595781",
          "Fvb2:3910071-3910371", "Fvb6:38530647-38530947",
          "Fvb1:20838882-20839182", "Fvb7:2371776-2372076",
          "Fvb3:4422491-4422791", "Fvb3:25339114-25339414",
          "Fvb2:11937991-11938291", "Fvb1:13168278-13168578",
          "Fvb6:16089728-16090028", "Fvb5:17220440-17220740",
          "Fvb4:28241403-28241703", "Fvb3:25755395-25755695",
          "Fvb2:14780953-14781253", "Fvb3:26494931-26495231",
          "Fvb4:14036438-14036738", "Fvb4:10711145-10711445",
          "Fvb3:26883775-26884075", "Fvb2:26839721-26840021",
          "Fvb2:16813086-16813386", "Fvb1:5457121-5457421",
          "Fvb5:17756666-17756966", "Fvb4:6837866-6838166",
          "Fvb4:13056569-13056869", "Fvb7:6561656-6561956",
          "Fvb6:7645840-7646140", "Fvb5:4496304-4496604",
          "Fvb5:18732246-18732546", "Fvb3:18254620-18254920",
          "Fvb3:12581005-12581305", "Fvb1:5079473-5079773",
          "Fvb1:21799824-21800124", "Fvb2:1587259-1587559",
          "Fvb6:5899236-5899536", "Fvb6:33415982-33416282",
          "Fvb5:14297040-14297340", "Fvb6:24754295-24754595",
          "Fvb4:12697641-12697941", "Fvb4:9375769-9376069",
          "Fvb3:24401791-24402091", "Fvb4:23507787-23508087",
          "Fvb7:20796864-20797164", "Fvb3:25399377-25399677",
          "Fvb5:19382139-19382439", "Fvb4:13914858-13915158",
          "Fvb2:349017-349317", "Fvb1:5226048-5226348",
          "Fvb1:22778368-22778668", "Fvb7:1333972-1334272",
          "Fvb5:8764633-8764933", "Fvb5:6803555-6803855",
          "Fvb4:7184637-7184937", "Fvb4:22205001-22205301",
          "Fvb4:14282731-14283031", "Fvb4:11969003-11969303",
          "Fvb2:10953549-10953849", "Fvb6:6196686-6196986",
          "Fvb6:26379091-26379391", "Fvb6:26336590-26336890",
          "Fvb6:26257116-26257416", "Fvb6:24304404-24304704",
          "Fvb6:17696134-17696434", "Fvb6:14932008-14932308",
          "Fvb5:7631680-7631980", "Fvb5:24496383-24496683",
          "Fvb5:23457737-23458037", "Fvb5:20894625-20894925",
          "Fvb5:12659837-12660137", "Fvb5:11975701-11976001",
          "Fvb4:9165254-9165554", "Fvb4:8335762-8336062",
          "Fvb4:31546748-31547048", "Fvb4:28941791-28942091",
          "Fvb4:26252956-26253256", "Fvb4:25306560-25306860",
          "Fvb4:24519694-24519994", "Fvb4:21107187-21107487",
          "Fvb4:20169859-20170159", "Fvb4:1798420-1798720",
          "Fvb4:16067529-16067829", "Fvb4:15682373-15682673",
          "Fvb4:13409691-13409991", "Fvb4:13276921-13277221",
          "Fvb4:12615741-12616041", "Fvb4:12383720-12384020",
          "Fvb4:10022309-10022609", "Fvb3:4782270-4782570",
          "Fvb3:31833669-31833969", "Fvb3:26362904-26363204",
          "Fvb3:20293249-20293549", "Fvb3:14420217-14420517",
          "Fvb2:28757292-28757592", "Fvb2:19376277-19376577",
          "Fvb1:6317172-6317472", "Fvb1:23112936-23113236",
          "Fvb1:23054079-23054379", "Fvb1:22773879-22774179",
          "Fvb1:21244757-21245057", "Fvb1:19732981-19733281",
          "Fvb1:18169247-18169547", "Fvb1:16932995-16933295",
          "Fvb1:16824515-16824815", "Fvb6:5502610-5502910",
          "Fvb4:10288949-10289249", "Fvb4:8758767-8759067",
          "Fvb5:15331597-15331897", "Fvb6:6318751-6319051",
          "Fvb6:19413145-19413445", "Fvb6:16025371-16025671",
          "Fvb4:19733092-19733392", "Fvb2:8469739-8470039",
          "Fvb6:23712197-23712497", "Fvb4:11201123-11201423",
          "Fvb6:29877180-29877480", "Fvb4:7122621-7122921",
          "Fvb2:10689146-10689446", "Fvb6:38804001-38804301",
          "Fvb5:15046632-15046932", "Fvb4:29517012-29517312",
          "Fvb3:32512347-32512647", "Fvb2:4735686-4735986",
          "Fvb2:22098193-22098493", "Fvb1:22205587-22205887",
          "Fvb1:21167718-21168018", "Fvb4:12404663-12404963",
          "Fvb4:9279424-9279724", "Fvb6:18432471-18432771",
          "Fvb1:1804851-1805151", "Fvb7:13258737-13259037",
          "Fvb6:21905264-21905564", "Fvb5:29100994-29101294",
          "Fvb4:12606035-12606335", "Fvb3:22970324-22970624",
          "Fvb2:13529311-13529611", "Fvb1:21897879-21898179",
          "Fvb2:18107380-18107680", "Fvb7:5925825-5926125",
          "Fvb4:23872536-23872836", "Fvb2:8585270-8585570",
          "Fvb2:2530606-2530906", "Fvb6:29958735-29959035",
          "Fvb7:11594940-11595240", "Fvb7:20694161-20694461",
          "Fvb7:19415476-19415776", "Fvb4:5984687-5984987",
          "Fvb3:27556460-27556760", "Fvb2:114776-115076",
          "Fvb1:15813830-15814130", "Fvb2:28387884-28388184",
          "Fvb1:7581225-7581525", "Fvb1:7999082-7999382",
          "Fvb2:21313671-21313971", "Fvb5:14254407-14254707",
          "Fvb4:11840646-11840946", "Fvb6:2738921-2739221",
          "Fvb1:17659632-17659932", "Fvb4:6164807-6165107",
          "Fvb4:20238008-20238308", "Fvb4:10271692-10271992",
          "Fvb3:6615580-6615880", "Fvb2:714977-715277", "Fvb2:405981-406281",
          "Fvb2:21297559-21297859", "Fvb2:16502206-16502506",
          "Fvb5:29363226-29363526", "Fvb7:2458602-2458902",
          "Fvb7:13540914-13541214", "Fvb6:9880914-9881214",
          "Fvb6:7938110-7938410", "Fvb6:37177777-37178077",
          "Fvb6:35930616-35930916", "Fvb6:35125077-35125377",
          "Fvb6:32516484-32516784", "Fvb6:30176180-30176480",
          "Fvb6:26698373-26698673", "Fvb6:1267030-1267330",
          "Fvb4:9712419-9712719", "Fvb4:5605214-5605514",
          "Fvb4:4924798-4925098", "Fvb4:26368593-26368893",
          "Fvb4:25739396-25739696", "Fvb4:24641832-24642132",
          "Fvb4:20189402-20189702", "Fvb4:20120091-20120391",
          "Fvb4:19151703-19152003", "Fvb4:15519541-15519841",
          "Fvb4:14598792-14599092", "Fvb4:14493430-14493730",
          "Fvb4:11862883-11863183", "Fvb4:11344568-11344868",
          "Fvb3:34320984-34321284", "Fvb3:24626179-24626479",
          "Fvb3:19324778-19325078", "Fvb3:14452911-14453211",
          "Fvb3:12620185-12620485", "Fvb2:8195207-8195507",
          "Fvb2:5060592-5060892", "Fvb2:27530328-27530628",
          "Fvb2:24289534-24289834", "Fvb2:22260137-22260437",
          "Fvb2:22240542-22240842", "Fvb2:21363779-21364079",
          "Fvb2:21230001-21230301", "Fvb2:21102610-21102910",
          "Fvb1:9550751-9551051", "Fvb1:23306762-23307062",
          "Fvb1:22224994-22225294", "Fvb1:22199552-22199852",
          "Fvb1:20170324-20170624", "Fvb1:14216424-14216724",
          "Fvb1:13972032-13972332", "Fvb1:12586172-12586472",
          "Fvb1:10329837-10330137", "Fvb7:14066071-14066371",
          "Fvb4:22923792-22924092", "Fvb5:28118145-28118445",
          "Fvb3:33218149-33218449", "Fvb6:38970893-38971193",
          "Fvb2:24928608-24928908", "Fvb2:23793259-23793559",
          "Fvb5:17553627-17553927", "Fvb6:24607293-24607593",
          "Fvb4:7790192-7790492", "Fvb7:4220224-4220524",
          "Fvb6:28791284-28791584", "Fvb6:22887610-22887910",
          "Fvb6:21954863-21955163", "Fvb5:21005918-21006218",
          "Fvb5:17966992-17967292", "Fvb4:9924925-9925225",
          "Fvb4:21713908-21714208", "Fvb3:10079643-10079943",
          "Fvb3:7583298-7583598", "Fvb3:5868364-5868664",
          "Fvb2:8088059-8088359", "Fvb4:8934418-8934718",
          "Fvb4:22370413-22370713", "Fvb3:8572510-8572810",
          "Fvb1:7839988-7840288", "Fvb1:15521191-15521491",
          "Fvb1:14995141-14995441", "Fvb4:17331221-17331521",
          "Fvb7:20641141-20641441", "Fvb5:20714481-20714781",
          "Fvb4:11858882-11859182", "Fvb3:21784057-21784357",
          "Fvb1:7639385-7639685", "Fvb6:30956155-30956455",
          "Fvb5:23348417-23348717", "Fvb1:2540754-2541054",
          "Fvb6:15068511-15068811", "Fvb4:25479182-25479482",
          "Fvb4:12494347-12494647", "Fvb4:11526470-11526770",
          "Fvb1:19836669-19836969", "Fvb3:23104773-23105073",
          "Fvb3:4379337-4379637", "Fvb1:22549747-22550047",
          "Fvb7:2632605-2632905", "Fvb5:27178847-27179147",
          "Fvb5:16258863-16259163", "Fvb4:9988688-9988988",
          "Fvb4:8794320-8794620", "Fvb4:17551291-17551591",
          "Fvb5:22656192-22656492", "Fvb2:16809361-16809661",
          "Fvb6:12138261-12138561", "Fvb5:22560360-22560660",
          "Fvb6:32333894-32334194", "Fvb6:18537315-18537615",
          "Fvb4:6140475-6140775", "Fvb3:32563133-32563433",
          "Fvb7:7550687-7550987", "Fvb7:4153163-4153463",
          "Fvb7:2975529-2975829", "Fvb7:2123833-2124133",
          "Fvb7:19894201-19894501", "Fvb7:19639183-19639483",
          "Fvb7:12669695-12669995", "Fvb7:12164984-12165284",
          "Fvb6:9416773-9417073", "Fvb6:6503676-6503976",
          "Fvb6:38886388-38886688", "Fvb6:17335885-17336185",
          "Fvb6:15079621-15079921", "Fvb6:14456921-14457221",
          "Fvb6:13435160-13435460", "Fvb6:11710188-11710488",
          "Fvb6:11114771-11115071", "Fvb5:8186896-8187196",
          "Fvb5:7107209-7107509", "Fvb5:6570020-6570320",
          "Fvb5:23991068-23991368", "Fvb5:23370353-23370653",
          "Fvb5:22674437-22674737", "Fvb5:183356-183656",
          "Fvb5:17184034-17184334", "Fvb5:16233268-16233568",
          "Fvb5:15454619-15454919", "Fvb4:8913028-8913328",
          "Fvb4:6781683-6781983", "Fvb4:28823736-28824036",
          "Fvb4:19454301-19454601", "Fvb4:18281567-18281867",
          "Fvb4:13606291-13606591", "Fvb4:13468286-13468586",
          "Fvb4:13254905-13255205", "Fvb4:12889222-12889522",
          "Fvb4:11596274-11596574", "Fvb4:1144546-1144846",
          "Fvb4:10058986-10059286", "Fvb3:7755066-7755366",
          "Fvb3:31473306-31473606", "Fvb3:25407146-25407446",
          "Fvb3:21096505-21096805", "Fvb3:20890785-20891085",
          "Fvb3:19422920-19423220", "Fvb2:26085075-26085375",
          "Fvb2:24206217-24206517", "Fvb2:20782527-20782827",
          "Fvb2:1897979-1898279", "Fvb2:17985095-17985395",
          "Fvb2:17932123-17932423", "Fvb2:16344389-16344689",
          "Fvb2:1360869-1361169", "Fvb1:3974351-3974651",
          "Fvb1:3319119-3319419", "Fvb1:23320902-23321202",
          "Fvb1:22695056-22695356", "Fvb1:22196568-22196868",
          "Fvb1:20521006-20521306", "Fvb1:15125184-15125484",
          "Fvb4:9964395-9964695", "Fvb7:23358848-23359148",
          "Fvb4:9980786-9981086", "Fvb3:15003471-15003771",
          "Fvb5:16759753-16760053", "Fvb2:18759897-18760197",
          "Fvb7:4532822-4533122", "Fvb5:23786389-23786689",
          "Fvb5:1932825-1933125", "Fvb4:14105493-14105793",
          "Fvb4:12609877-12610177", "Fvb4:11845392-11845692",
          "Fvb3:24958669-24958969", "Fvb3:21980321-21980621",
          "Fvb3:14155241-14155541", "Fvb2:20960579-20960879",
          "Fvb4:23860178-23860478", "Fvb6:35250850-35251150",
          "Fvb1:15944569-15944869", "Fvb4:20021607-20021907",
          "Fvb5:4358881-4359181", "Fvb3:3904913-3905213",
          "Fvb4:8426448-8426748", "Fvb4:6404878-6405178",
          "Fvb2:8316602-8316902", "Fvb2:5123984-5124284",
          "Fvb1:1480596-1480896", "Fvb6:13939378-13939678",
          "Fvb6:14486854-14487154", "Fvb5:17388856-17389156",
          "Fvb4:9303888-9304188", "Fvb3:13969151-13969451",
          "Fvb2:14123845-14124145", "Fvb1:21042418-21042718",
          "Fvb5:3291279-3291579", "Fvb4:4034106-4034406",
          "Fvb4:9474260-9474560", "Fvb3:17895638-17895938",
          "Fvb3:15703668-15703968", "Fvb1:20371410-20371710",
          "Fvb5:12568326-12568626", "Fvb2:25122106-25122406",
          "Fvb6:35910033-35910333", "Fvb6:8953809-8954109",
          "Fvb6:39343678-39343978", "Fvb5:27808538-27808838",
          "Fvb4:9475158-9475458", "Fvb4:8609102-8609402",
          "Fvb4:22702894-22703194", "Fvb3:23909808-23910108",
          "Fvb7:5930866-5931166", "Fvb6:35247794-35248094",
          "Fvb1:21557655-21557955", "Fvb7:2823010-2823310",
          "Fvb5:25301088-25301388", "Fvb4:24740420-24740720",
          "Fvb4:22911325-22911625", "Fvb1:21369304-21369604",
          "Fvb7:2447811-2448111", "Fvb7:21978154-21978454",
          "Fvb7:16094339-16094639", "Fvb7:10015536-10015836",
          "Fvb6:9987482-9987782", "Fvb6:31154533-31154833",
          "Fvb6:22948686-22948986", "Fvb6:20401856-20402156",
          "Fvb6:12491861-12492161", "Fvb6:12234341-12234641",
          "Fvb6:11957879-11958179", "Fvb6:11826110-11826410",
          "Fvb6:11095018-11095318", "Fvb5:24457041-24457341",
          "Fvb5:23969426-23969726", "Fvb5:23152671-23152971",
          "Fvb5:22179217-22179517", "Fvb5:21536474-21536774",
          "Fvb5:1895930-1896230", "Fvb5:18577755-18578055",
          "Fvb5:14352770-14353070", "Fvb5:10493330-10493630",
          "Fvb4:5155936-5156236", "Fvb4:32850461-32850761",
          "Fvb4:32550746-32551046", "Fvb4:32412874-32413174",
          "Fvb4:30685191-30685491", "Fvb4:28266161-28266461",
          "Fvb4:23915574-23915874", "Fvb4:23618726-23619026",
          "Fvb4:20195036-20195336", "Fvb4:1995535-1995835",
          "Fvb4:18004748-18005048", "Fvb4:13664203-13664503",
          "Fvb4:12401631-12401931", "Fvb4:11774256-11774556",
          "Fvb4:11447992-11448292", "Fvb4:11113728-11114028",
          "Fvb4:10344851-10345151", "Fvb3:9431280-9431580",
          "Fvb3:37109183-37109483", "Fvb3:3003287-3003587",
          "Fvb3:26588081-26588381", "Fvb3:26566994-26567294",
          "Fvb3:26370179-26370479", "Fvb3:25486296-25486596",
          "Fvb3:24971598-24971898", "Fvb3:16341997-16342297",
          "Fvb2:910208-910508", "Fvb2:7538497-7538797",
          "Fvb2:2375094-2375394", "Fvb2:21493459-21493759",
          "Fvb1:21588462-21588762", "Fvb1:20302570-20302870",
          "Fvb1:18450122-18450422", "Fvb1:10259102-10259402",
          "contig_5:17967-18267", "Fvb5:735631-735931",
          "Fvb5:1420721-1421021", "Fvb2:27970518-27970818",
          "Fvb2:17179492-17179792", "Fvb1:9248948-9249248",
          "Fvb1:20219866-20220166", "Fvb6:36387116-36387416",
          "Fvb4:18822006-18822306", "Fvb7:5288572-5288872",
          "Fvb7:14077650-14077950", "Fvb4:10174012-10174312",
          "Fvb3:24498954-24499254", "Fvb3:17301128-17301428",
          "Fvb3:10484994-10485294", "Fvb2:21854380-21854680",
          "Fvb1:15347173-15347473", "Fvb1:13962458-13962758",
          "Fvb5:16753898-16754198", "Fvb2:9474470-9474770",
          "Fvb1:8562498-8562798", "Fvb6:34911971-34912271",
          "Fvb4:10384174-10384474", "Fvb2:6988543-6988843",
          "Fvb4:13564240-13564540", "Fvb3:31587730-31588030",
          "Fvb3:29652825-29653125", "Fvb3:25857922-25858222",
          "Fvb2:5842170-5842470", "Fvb3:26974280-26974580",
          "Fvb5:14985956-14986256", "Fvb6:13960030-13960330",
          "Fvb6:35029457-35029757", "Fvb6:10197439-10197739",
          "Fvb5:25813143-25813443", "Fvb5:14692227-14692527",
          "Fvb4:13462698-13462998", "Fvb3:29690422-29690722",
          "Fvb3:23301132-23301432", "Fvb3:19548821-19549121",
          "Fvb2:26239638-26239938", "Fvb4:11888785-11889085",
          "Fvb7:15089668-15089968", "Fvb7:22731038-22731338",
          "Fvb4:11886051-11886351", "Fvb6:15934248-15934548",
          "Fvb7:17651612-17651912", "Fvb1:4225614-4225914",
          "Fvb1:10816647-10816947", "Fvb6:32030804-32031104",
          "Fvb5:8562265-8562565", "Fvb5:19814929-19815229",
          "Fvb4:7894369-7894669", "Fvb4:14534695-14534995",
          "Fvb1:869292-869592", "Fvb1:19219871-19220171",
          "Fvb5:8923943-8924243", "Fvb2:5488308-5488608",
          "Fvb5:4340968-4341268", "Fvb6:20250154-20250454",
          "Fvb4:12710958-12711258", "Fvb3:24871753-24872053",
          "Fvb4:15439282-15439582", "Fvb7:8708993-8709293",
          "Fvb7:8478929-8479229", "Fvb7:716035-716335",
          "Fvb7:6168886-6169186", "Fvb7:20252650-20252950",
          "Fvb7:13871075-13871375", "Fvb6:4526537-4526837",
          "Fvb6:4082395-4082695", "Fvb6:4020551-4020851",
          "Fvb6:28842319-28842619", "Fvb6:23926053-23926353",
          "Fvb6:21883383-21883683", "Fvb6:19371600-19371900",
          "Fvb6:17868283-17868583", "Fvb6:13160181-13160481",
          "Fvb6:12570401-12570701", "Fvb5:2824982-2825282",
          "Fvb5:20442490-20442790", "Fvb5:16057846-16058146",
          "Fvb5:15717211-15717511", "Fvb5:1073032-1073332",
          "Fvb5:10008438-10008738", "Fvb4:9887473-9887773",
          "Fvb4:8917989-8918289", "Fvb4:8673759-8674059",
          "Fvb4:4124139-4124439", "Fvb4:32024702-32025002",
          "Fvb4:30439833-30440133", "Fvb4:23504052-23504352",
          "Fvb4:21212540-21212840", "Fvb4:19461331-19461631",
          "Fvb4:1915560-1915860", "Fvb4:17888575-17888875",
          "Fvb4:16481984-16482284", "Fvb4:15879377-15879677",
          "Fvb4:13546111-13546411", "Fvb4:12390626-12390926",
          "Fvb4:11255251-11255551", "Fvb3:6137777-6138077",
          "Fvb3:577348-577648", "Fvb3:5135703-5136003",
          "Fvb3:3491082-3491382", "Fvb3:30802271-30802571",
          "Fvb3:29753748-29754048", "Fvb3:27036076-27036376",
          "Fvb3:25562841-25563141", "Fvb3:24429555-24429855",
          "Fvb3:23534390-23534690", "Fvb3:22414608-22414908",
          "Fvb3:19759790-19760090", "Fvb3:1484192-1484492",
          "Fvb3:13361334-13361634", "Fvb3:11447118-11447418",
          "Fvb2:9161533-9161833", "Fvb2:8181903-8182203",
          "Fvb2:7455753-7456053", "Fvb2:62420-62720",
          "Fvb2:24655435-24655735", "Fvb2:1906604-1906904",
          "Fvb2:13537088-13537388", "Fvb2:13482808-13483108",
          "Fvb1:7323013-7323313", "Fvb1:7126603-7126903",
          "Fvb1:5284497-5284797", "Fvb1:3810312-3810612",
          "Fvb1:23161559-23161859", "Fvb1:21316345-21316645",
          "Fvb1:17064689-17064989", "Fvb1:13237529-13237829",
          "Fvb3:17664667-17664967", "Fvb7:4149600-4149900",
          "Fvb6:23472748-23473048", "Fvb2:25566316-25566616",
          "Fvb2:24701133-24701433", "Fvb7:20393839-20394139",
          "Fvb7:13315057-13315357", "Fvb6:18329551-18329851",
          "Fvb5:23286239-23286539", "Fvb4:4034872-4035172",
          "Fvb4:11339031-11339331", "Fvb3:26389796-26390096",
          "Fvb3:10856528-10856828", "Fvb6:17878522-17878822",
          "Fvb5:11022853-11023153", "Fvb4:26439928-26440228",
          "Fvb3:24278178-24278478", "Fvb3:23729569-23729869",
          "Fvb2:3645924-3646224", "Fvb1:22927621-22927921",
          "Fvb4:27388860-27389160", "Fvb6:1720204-1720504",
          "Fvb5:15702536-15702836", "Fvb4:20073714-20074014",
          "Fvb1:20774086-20774386", "Fvb7:20280604-20280904",
          "Fvb7:1437354-1437654", "Fvb1:16233041-16233341",
          "Fvb5:11669165-11669465", "Fvb1:20052792-20053092",
          "Fvb4:5523343-5523643", "Fvb6:24309654-24309954",
          "Fvb4:2007268-2007568", "Fvb4:12420608-12420908",
          "Fvb4:11506521-11506821", "Fvb2:4437273-4437573",
          "Fvb7:5410674-5410974", "Fvb7:18779944-18780244",
          "Fvb6:7581881-7582181", "Fvb6:6794073-6794373",
          "Fvb6:28923924-28924224", "Fvb6:16422891-16423191",
          "Fvb4:8736900-8737200", "Fvb4:13704440-13704740",
          "Fvb4:10111537-10111837", "Fvb2:23586414-23586714",
          "Fvb1:23369925-23370225", "Fvb6:6826091-6826391",
          "Fvb6:21769951-21770251", "Fvb2:24504134-24504434",
          "Fvb7:1137503-1137803", "Fvb4:28844273-28844573",
          "Fvb1:18153870-18154170", "Fvb3:13909204-13909504",
          "Fvb2:4690775-4691075", "Fvb7:10953114-10953414",
          "Fvb6:25520941-25521241", "Fvb2:19000810-19001110",
          "Fvb7:4078588-4078888", "Fvb7:3964697-3964997",
          "Fvb6:37902481-37902781", "Fvb5:3104038-3104338",
          "Fvb3:27141443-27141743", "Fvb2:9254941-9255241",
          "Fvb2:19395208-19395508", "Fvb2:14083734-14084034",
          "Fvb5:29358344-29358644", "Fvb7:19203145-19203445",
          "Fvb1:19226890-19227190", "Fvb1:12185152-12185452",
          "Fvb4:13236460-13236760", "Fvb3:24093304-24093604",
          "Fvb3:25700522-25700822", "Fvb2:327833-328133",
          "Fvb7:9439033-9439333", "Fvb7:3944076-3944376",
          "Fvb7:2189287-2189587", "Fvb7:20562961-20563261",
          "Fvb6:8772717-8773017", "Fvb6:29523598-29523898",
          "Fvb6:26192218-26192518", "Fvb6:25401521-25401821",
          "Fvb6:22242306-22242606", "Fvb6:18125451-18125751",
          "Fvb6:18014083-18014383", "Fvb6:17417380-17417680",
          "Fvb6:17135436-17135736", "Fvb6:16999787-17000087",
          "Fvb6:15983734-15984034", "Fvb6:14642105-14642405",
          "Fvb6:13209269-13209569", "Fvb6:12787453-12787753",
          "Fvb6:12095063-12095363", "Fvb6:11937102-11937402",
          "Fvb5:28812993-28813293", "Fvb5:27612692-27612992",
          "Fvb5:26514026-26514326", "Fvb5:26147427-26147727",
          "Fvb5:2512376-2512676", "Fvb5:24015164-24015464",
          "Fvb5:21484380-21484680", "Fvb5:18928491-18928791",
          "Fvb5:17052357-17052657", "Fvb5:16663842-16664142",
          "Fvb5:16402231-16402531", "Fvb4:8254401-8254701",
          "Fvb4:7769142-7769442", "Fvb4:6960228-6960528",
          "Fvb4:5151942-5152242", "Fvb4:45617-45917",
          "Fvb4:26563028-26563328", "Fvb4:20070758-20071058",
          "Fvb4:19382651-19382951", "Fvb4:15883957-15884257",
          "Fvb4:13594983-13595283", "Fvb4:13495596-13495896",
          "Fvb4:12545910-12546210", "Fvb4:11631985-11632285",
          "Fvb4:1145463-1145763", "Fvb3:38067124-38067424",
          "Fvb3:3356203-3356503", "Fvb3:32502133-32502433",
          "Fvb3:30987343-30987643", "Fvb3:30778738-30779038",
          "Fvb3:29415584-29415884", "Fvb3:26391582-26391882",
          "Fvb3:26252712-26253012", "Fvb3:26139420-26139720",
          "Fvb3:25226776-25227076", "Fvb3:19804966-19805266",
          "Fvb3:19105837-19106137", "Fvb3:18627149-18627449",
          "Fvb3:18376667-18376967", "Fvb3:15368876-15369176",
          "Fvb3:14788777-14789077", "Fvb3:12893245-12893545",
          "Fvb3:10371232-10371532", "Fvb2:88294-88594",
          "Fvb2:5595415-5595715", "Fvb2:3202052-3202352",
          "Fvb2:25640590-25640890", "Fvb2:20282100-20282400",
          "Fvb2:19698789-19699089", "Fvb2:15682380-15682680",
          "Fvb1:6826849-6827149", "Fvb1:4366858-4367158",
          "Fvb1:21894853-21895153", "Fvb1:19265587-19265887",
          "Fvb1:16859868-16860168", "Fvb7:5503289-5503589",
          "Fvb6:15691203-15691503", "Fvb5:28750325-28750625",
          "Fvb5:1925517-1925817", "Fvb4:26825507-26825807",
          "Fvb3:33933479-33933779", "Fvb3:1623728-1624028",
          "Fvb1:8549856-8550156", "Fvb6:22072080-22072380",
          "Fvb4:33575040-33575340", "Fvb2:14869411-14869711",
          "Fvb1:20562023-20562323", "Fvb4:6412587-6412887",
          "Fvb2:4135910-4136210", "Fvb2:23440727-23441027",
          "Fvb7:17622557-17622857", "Fvb6:24057426-24057726",
          "Fvb6:18618099-18618399", "Fvb4:9133497-9133797",
          "Fvb4:13119674-13119974", "Fvb1:12010719-12011019",
          "Fvb6:34832487-34832787", "Fvb1:20338152-20338452",
          "Fvb5:12691310-12691610", "Fvb6:11557327-11557627",
          "Fvb4:17548149-17548449", "Fvb3:3783019-3783319",
          "Fvb5:14559858-14560158", "Fvb1:1051642-1051942",
          "Fvb7:20584084-20584384", "Fvb3:36776693-36776993",
          "Fvb2:28232162-28232462", "Fvb3:35694208-35694508",
          "Fvb6:27912891-27913191", "Fvb6:18769422-18769722",
          "Fvb5:17786210-17786510", "Fvb4:29811680-29811980",
          "Fvb5:6007040-6007340", "Fvb4:27396658-27396958",
          "Fvb6:11732214-11732514", "Fvb4:9730298-9730598",
          "Fvb4:4799553-4799853", "Fvb2:25591242-25591542",
          "Fvb2:2335916-2336216", "Fvb1:22553254-22553554",
          "Fvb4:31952731-31953031", "Fvb4:19349458-19349758",
          "Fvb4:9099611-9099911", "Fvb2:10026378-10026678",
          "Fvb4:7715827-7716127", "Fvb7:16171853-16172153",
          "Fvb5:2975829-2976129", "Fvb5:17309073-17309373",
          "Fvb4:5692505-5692805", "Fvb3:5777353-5777653",
          "Fvb3:18900901-18901201", "Fvb2:3932883-3933183",
          "Fvb2:24239356-24239656", "Fvb2:16810462-16810762",
          "Fvb4:16870427-16870727", "Fvb4:2681739-2682039",
          "Fvb3:2584245-2584545", "Fvb6:1671624-1671924",
          "Fvb6:14786729-14787029", "Fvb5:26532068-26532368",
          "Fvb2:24998904-24999204", "Fvb2:25306274-25306574",
          "Fvb7:3476135-3476435", "Fvb5:26704377-26704677",
          "Fvb4:7886168-7886468", "Fvb4:25643875-25644175",
          "Fvb4:23439282-23439582", "Fvb6:30728884-30729184",
          "Fvb6:10586146-10586446", "Fvb2:13601017-13601317",
          "Fvb7:831921-832221", "Fvb7:5047970-5048270",
          "Fvb7:2959001-2959301", "Fvb7:22204685-22204985",
          "Fvb7:19308485-19308785", "Fvb7:17889438-17889738",
          "Fvb7:13790975-13791275", "Fvb7:1145658-1145958",
          "Fvb7:11334244-11334544", "Fvb6:6801077-6801377",
          "Fvb6:34275635-34275935", "Fvb6:28453486-28453786",
          "Fvb6:25355923-25356223", "Fvb6:22370317-22370617",
          "Fvb6:20965034-20965334", "Fvb6:17409049-17409349",
          "Fvb6:12958349-12958649", "Fvb6:12558900-12559200",
          "Fvb5:9478745-9479045", "Fvb5:8940789-8941089",
          "Fvb5:250642-250942", "Fvb5:22363030-22363330",
          "Fvb5:15016964-15017264", "Fvb5:12685607-12685907",
          "Fvb5:1008055-1008355", "Fvb4:7795246-7795546",
          "Fvb4:541461-541761", "Fvb4:5182110-5182410",
          "Fvb4:30896062-30896362", "Fvb4:30471282-30471582",
          "Fvb4:27732711-27733011", "Fvb4:20549316-20549616",
          "Fvb4:20173298-20173598", "Fvb4:19159610-19159910",
          "Fvb4:19013692-19013992", "Fvb4:15583680-15583980",
          "Fvb4:14179718-14180018", "Fvb4:13717946-13718246",
          "Fvb4:13440293-13440593", "Fvb4:13422084-13422384",
          "Fvb4:11913338-11913638", "Fvb4:1162223-1162523",
          "Fvb4:11031501-11031801", "Fvb4:10512548-10512848",
          "Fvb4:10150674-10150974", "Fvb4:10050562-10050862",
          "Fvb3:8317122-8317422", "Fvb3:3954197-3954497",
          "Fvb3:28773556-28773856", "Fvb3:27412000-27412300",
          "Fvb3:26916734-26917034", "Fvb3:25473880-25474180",
          "Fvb3:23867768-23868068", "Fvb3:19771131-19771431",
          "Fvb3:17325431-17325731", "Fvb2:9489555-9489855",
          "Fvb2:7439565-7439865", "Fvb2:7324625-7324925",
          "Fvb2:6992572-6992872", "Fvb2:6583059-6583359",
          "Fvb2:27396697-27396997", "Fvb2:26792384-26792684",
          "Fvb2:25215472-25215772", "Fvb2:21455841-21456141",
          "Fvb2:11440355-11440655", "Fvb1:23828428-23828728",
          "Fvb1:20349579-20349879", "Fvb1:20303084-20303384",
          "Fvb1:19501780-19502080", "Fvb1:18157736-18158036",
          "Fvb1:11761797-11762097", "Fvb6:12196332-12196632",
          "Fvb4:13139306-13139606", "Fvb3:6547401-6547701",
          "Fvb3:22679486-22679786", "Fvb6:4717116-4717416",
          "Fvb6:33080236-33080536", "Fvb5:2556911-2557211",
          "Fvb4:33374025-33374325", "Fvb2:11962629-11962929",
          "Fvb5:15238083-15238383", "Fvb2:17459835-17460135",
          "Fvb2:13338864-13339164", "Fvb1:23109648-23109948",
          "Fvb7:6887243-6887543", "Fvb3:4251112-4251412",
          "Fvb3:36885902-36886202", "Fvb6:3844542-3844842",
          "Fvb6:13233054-13233354", "Fvb3:26354017-26354317",
          "Fvb7:23395121-23395421", "Fvb4:8056720-8057020",
          "Fvb4:30965135-30965435", "Fvb2:11688289-11688589",
          "Fvb1:22469729-22470029", "Fvb4:15514922-15515222",
          "Fvb4:13841576-13841876", "Fvb4:12579541-12579841",
          "Fvb3:21497909-21498209", "Fvb3:18340477-18340777",
          "Fvb3:11916780-11917080", "Fvb1:12298736-12299036",
          "Fvb6:15305685-15305985", "Fvb4:9883614-9883914",
          "Fvb3:15925223-15925523", "Fvb1:22259760-22260060",
          "Fvb7:2785572-2785872", "Fvb3:29607840-29608140",
          "Fvb6:9105705-9106005", "Fvb4:32365164-32365464",
          "Fvb4:15354308-15354608", "Fvb3:26296492-26296792",
          "Fvb3:24766323-24766623", "Fvb2:183906-184206",
          "Fvb2:28680868-28681168", "Fvb6:4041676-4041976",
          "Fvb4:15794158-15794458", "Fvb1:13063464-13063764",
          "Fvb1:2963520-2963820", "Fvb3:506778-507078",
          "Fvb7:5931924-5932224", "Fvb4:22937469-22937769",
          "Fvb3:24769041-24769341", "Fvb3:8060222-8060522",
          "Fvb7:5497571-5497871", "Fvb2:4538684-4538984",
          "Fvb6:39220832-39221132", "Fvb1:20666985-20667285",
          "Fvb1:10057506-10057806", "Fvb4:12674141-12674441",
          "Fvb3:501850-502150", "Fvb4:5739921-5740221",
          "Fvb7:9805549-9805849", "Fvb7:22598291-22598591",
          "Fvb7:11504739-11505039", "Fvb7:11297138-11297438",
          "Fvb6:9951909-9952209", "Fvb6:32523684-32523984",
          "Fvb6:29486590-29486890", "Fvb6:23746102-23746402",
          "Fvb6:21711154-21711454", "Fvb6:1941775-1942075",
          "Fvb6:16462632-16462932", "Fvb6:14597692-14597992",
          "Fvb6:11998725-11999025", "Fvb6:11994599-11994899",
          "Fvb5:9757415-9757715", "Fvb5:6336524-6336824",
          "Fvb5:27623675-27623975", "Fvb5:24129092-24129392",
          "Fvb5:2275682-2275982", "Fvb5:15018523-15018823",
          "Fvb5:1300872-1301172", "Fvb4:9967260-9967560",
          "Fvb4:9873294-9873594", "Fvb4:9226604-9226904",
          "Fvb4:8259036-8259336", "Fvb4:6713644-6713944",
          "Fvb4:6045700-6046000", "Fvb4:5292622-5292922",
          "Fvb4:33028357-33028657", "Fvb4:30728538-30728838",
          "Fvb4:22387740-22388040", "Fvb4:20009927-20010227",
          "Fvb4:15948520-15948820", "Fvb4:15773097-15773397",
          "Fvb4:12594228-12594528", "Fvb4:12557812-12558112",
          "Fvb4:11651080-11651380", "Fvb4:11571271-11571571",
          "Fvb4:11332445-11332745", "Fvb4:10971136-10971436",
          "Fvb4:10931057-10931357", "Fvb4:10814865-10815165",
          "Fvb4:10800403-10800703", "Fvb4:10575214-10575514",
          "Fvb3:37754515-37754815", "Fvb3:32028878-32029178",
          "Fvb3:30561375-30561675", "Fvb3:26484135-26484435",
          "Fvb3:20294544-20294844", "Fvb3:19325520-19325820",
          "Fvb3:18199108-18199408", "Fvb3:12659909-12660209",
          "Fvb3:10982998-10983298", "Fvb2:6819813-6820113",
          "Fvb2:6240771-6241071", "Fvb2:1625835-1626135",
          "Fvb2:15753970-15754270", "Fvb2:15595368-15595668",
          "Fvb1:7297769-7298069", "Fvb1:5263984-5264284",
          "Fvb1:5259849-5260149", "Fvb1:22619326-22619626",
          "Fvb1:21964371-21964671", "Fvb1:21644531-21644831",
          "Fvb1:20671556-20671856", "Fvb1:20378432-20378732",
          "Fvb1:19911102-19911402", "Fvb1:19612142-19612442",
          "Fvb1:18329751-18330051", "Fvb1:11692266-11692566",
          "Fvb7:6548272-6548572", "Fvb7:3136455-3136755",
          "Fvb6:3929884-3930184", "Fvb6:23709594-23709894",
          "Fvb6:16399900-16400200", "Fvb4:8705578-8705878",
          "Fvb4:10941356-10941656", "Fvb3:16306606-16306906",
          "Fvb1:3078356-3078656", "Fvb1:2092540-2092840",
          "Fvb1:14858993-14859293", "Fvb2:16581138-16581438",
          "Fvb3:26875966-26876266", "Fvb6:25231902-25232202",
          "Fvb2:12344992-12345292", "Fvb2:3941166-3941466",
          "Fvb2:23520428-23520728", "Fvb4:19752904-19753204",
          "Fvb3:28765591-28765891", "Fvb4:11613684-11613984",
          "Fvb7:23080354-23080654", "Fvb5:7476289-7476589",
          "Fvb4:11155714-11156014", "Fvb6:38846238-38846538",
          "Fvb5:9369579-9369879", "Fvb4:30992403-30992703",
          "Fvb3:7948949-7949249", "Fvb3:27004167-27004467",
          "Fvb3:21783257-21783557", "Fvb1:18107191-18107491",
          "Fvb6:21374218-21374518", "Fvb4:11249562-11249862",
          "Fvb3:26920260-26920560", "Fvb7:15708310-15708610",
          "Fvb7:11357476-11357776", "Fvb5:5369165-5369465",
          "Fvb4:26690986-26691286", "Fvb4:14443736-14444036",
          "Fvb4:12348468-12348768", "Fvb4:11848310-11848610",
          "Fvb3:27247059-27247359", "Fvb2:18495266-18495566",
          "Fvb2:18208273-18208573", "Fvb1:6650988-6651288",
          "Fvb1:23210929-23211229", "Fvb1:21428033-21428333",
          "Fvb1:16011485-16011785", "Fvb6:10249286-10249586",
          "Fvb5:1049792-1050092", "Fvb3:6889821-6890121",
          "Fvb1:20172696-20172996", "Fvb1:11616628-11616928",
          "Fvb3:26245548-26245848", "Fvb7:16232214-16232514",
          "Fvb4:25799445-25799745", "Fvb4:6881769-6882069",
          "Fvb7:4087982-4088282", "Fvb3:27815970-27816270",
          "Fvb1:7096709-7097009", "Fvb1:23010447-23010747",
          "Fvb5:7216621-7216921", "Fvb5:21858859-21859159",
          "Fvb2:23205807-23206107", "Fvb5:2138899-2139199",
          "Fvb5:21286856-21287156", "Fvb5:16647341-16647641",
          "Fvb4:14051621-14051921", "Fvb4:12501575-12501875",
          "Fvb3:31593883-31594183", "Fvb3:26800183-26800483",
          "Fvb1:20544529-20544829", "Fvb1:17930759-17931059",
          "Fvb7:13652990-13653290", "Fvb4:32970995-32971295",
          "Fvb7:9782528-9782828", "Fvb7:952035-952335",
          "Fvb7:22406990-22407290", "Fvb7:17831429-17831729",
          "Fvb7:17823146-17823446", "Fvb7:1233027-1233327",
          "Fvb7:11803502-11803802", "Fvb6:5727752-5728052",
          "Fvb6:39551323-39551623", "Fvb6:35728792-35729092",
          "Fvb6:35045411-35045711", "Fvb6:30305100-30305400",
          "Fvb6:28454128-28454428", "Fvb6:24110560-24110860",
          "Fvb6:23545951-23546251", "Fvb6:2057033-2057333",
          "Fvb6:20014247-20014547", "Fvb6:19091722-19092022",
          "Fvb6:1894374-1894674", "Fvb6:1735139-1735439",
          "Fvb6:12418591-12418891", "Fvb5:534591-534891",
          "Fvb5:4911674-4911974", "Fvb5:3692446-3692746",
          "Fvb5:27080159-27080459", "Fvb5:26412931-26413231",
          "Fvb5:25295413-25295713", "Fvb5:23582852-23583152",
          "Fvb5:22955135-22955435", "Fvb5:22567791-22568091",
          "Fvb5:2146499-2146799", "Fvb5:20934477-20934777",
          "Fvb5:17625839-17626139", "Fvb5:13374974-13375274",
          "Fvb5:12938382-12938682", "Fvb4:9077741-9078041",
          "Fvb4:8355689-8355989", "Fvb4:7973850-7974150",
          "Fvb4:3168911-3169211", "Fvb4:30661550-30661850",
          "Fvb4:29728655-29728955", "Fvb4:29511176-29511476",
          "Fvb4:26443191-26443491", "Fvb4:21592514-21592814",
          "Fvb4:18753733-18754033", "Fvb4:18279749-18280049",
          "Fvb4:17496775-17497075", "Fvb4:14310985-14311285",
          "Fvb4:14173516-14173816", "Fvb4:14103015-14103315",
          "Fvb4:13420907-13421207", "Fvb4:13229953-13230253",
          "Fvb4:12670175-12670475", "Fvb4:12284205-12284505",
          "Fvb4:11499833-11500133", "Fvb4:10732469-10732769",
          "Fvb3:7822986-7823286", "Fvb3:37734201-37734501",
          "Fvb3:29541398-29541698", "Fvb3:28111471-28111771",
          "Fvb3:27604316-27604616", "Fvb3:26028571-26028871",
          "Fvb3:25579884-25580184", "Fvb3:25464867-25465167",
          "Fvb3:25444494-25444794", "Fvb3:23606313-23606613",
          "Fvb3:21119525-21119825", "Fvb3:19835683-19835983",
          "Fvb3:13664401-13664701", "Fvb2:9664971-9665271",
          "Fvb2:709659-709959", "Fvb2:5175826-5176126",
          "Fvb2:4767101-4767401", "Fvb2:3323703-3324003",
          "Fvb2:2745257-2745557", "Fvb2:1647831-1648131",
          "Fvb2:15719699-15719999", "Fvb2:12744636-12744936",
          "Fvb1:5443503-5443803", "Fvb1:4709708-4710008",
          "Fvb1:23538795-23539095", "Fvb1:22192224-22192524",
          "Fvb1:20782721-20783021", "Fvb1:20220450-20220750",
          "Fvb1:18929542-18929842", "Fvb1:18464874-18465174",
          "Fvb1:14417667-14417967", "Fvb4:14219316-14219616",
          "Fvb1:23356148-23356448", "Fvb6:8393830-8394130",
          "Fvb4:8614657-8614957", "Fvb4:11013408-11013708",
          "Fvb6:26472988-26473288", "Fvb7:19718772-19719072",
          "Fvb4:21111328-21111628", "Fvb4:6118826-6119126",
          "Fvb4:32088504-32088804", "Fvb7:16007278-16007578",
          "Fvb7:10018649-10018949", "Fvb6:37041599-37041899",
          "Fvb6:26035293-26035593", "Fvb6:36442166-36442466",
          "Fvb6:14579270-14579570", "Fvb4:6245547-6245847",
          "Fvb4:270747-271047", "Fvb4:10901624-10901924",
          "Fvb3:20282630-20282930", "Fvb4:8798372-8798672",
          "Fvb5:26333400-26333700", "Fvb6:33374567-33374867",
          "Fvb7:19591329-19591629", "Fvb5:5978549-5978849",
          "Fvb5:14212273-14212573", "Fvb4:11747042-11747342",
          "Fvb4:10989661-10989961", "Fvb3:7116491-7116791",
          "Fvb3:25121162-25121462", "Fvb3:17692058-17692358",
          "Fvb2:22560581-22560881", "Fvb3:14444253-14444553",
          "Fvb6:8773852-8774152", "Fvb4:12448306-12448606",
          "Fvb3:38314204-38314504", "Fvb3:20932604-20932904",
          "Fvb1:4188082-4188382", "Fvb1:23644487-23644787",
          "Fvb1:21576284-21576584", "Fvb1:14381637-14381937",
          "Fvb7:16139507-16139807", "Fvb4:7899803-7900103",
          "Fvb2:8064050-8064350", "Fvb6:35848279-35848579",
          "Fvb4:8642630-8642930", "Fvb3:29180335-29180635",
          "Fvb3:11909593-11909893", "Fvb6:6186576-6186876",
          "Fvb3:7299849-7300149", "Fvb5:8898669-8898969",
          "Fvb3:582507-582807", "Fvb3:29838190-29838490",
          "Fvb1:2310355-2310655", "Fvb3:26645024-26645324",
          "Fvb6:2433788-2434088", "Fvb7:12321237-12321537",
          "Fvb5:988082-988382", "Fvb4:13695046-13695346",
          "Fvb4:12982345-12982645", "Fvb3:26146782-26147082",
          "Fvb3:17479879-17480179", "Fvb1:22471422-22471722",
          "Fvb1:1190394-1190694", "Fvb4:24572584-24572884",
          "Fvb3:33233286-33233586", "Fvb5:11958057-11958357",
          "Fvb4:32010017-32010317", "Fvb7:18337667-18337967",
          "Fvb6:7325187-7325487", "Fvb6:24842570-24842870",
          "Fvb4:12164288-12164588", "Fvb3:31997405-31997705",
          "Fvb3:2866381-2866681", "Fvb3:16447736-16448036",
          "Fvb2:28433594-28433894", "Fvb2:23673560-23673860",
          "Fvb2:21655161-21655461", "Fvb2:2110448-2110748",
          "Fvb2:15375520-15375820", "Fvb2:13592931-13593231",
          "Fvb1:19494384-19494684", "Fvb7:8114743-8115043",
          "Fvb7:4720586-4720886", "Fvb7:21138398-21138698",
          "Fvb7:19345188-19345488", "Fvb7:14054961-14055261",
          "Fvb7:13132400-13132700", "Fvb7:12154468-12154768",
          "Fvb6:7526069-7526369", "Fvb6:3536312-3536612",
          "Fvb6:32787305-32787605", "Fvb6:32542788-32543088",
          "Fvb6:23883024-23883324", "Fvb6:22739693-22739993",
          "Fvb6:20639911-20640211", "Fvb6:20022231-20022531",
          "Fvb6:19990194-19990494", "Fvb6:16964528-16964828",
          "Fvb5:9000779-9001079", "Fvb5:5094824-5095124",
          "Fvb5:3251767-3252067", "Fvb5:29094589-29094889",
          "Fvb5:28760139-28760439", "Fvb5:25916980-25917280",
          "Fvb5:25552308-25552608", "Fvb5:24806665-24806965",
          "Fvb5:21532467-21532767", "Fvb5:20264777-20265077",
          "Fvb5:18774262-18774562", "Fvb5:18029748-18030048",
          "Fvb5:16523656-16523956", "Fvb5:15609214-15609514",
          "Fvb5:13046479-13046779", "Fvb5:11654280-11654580",
          "Fvb4:8778805-8779105", "Fvb4:8713509-8713809",
          "Fvb4:8633969-8634269", "Fvb4:4727313-4727613",
          "Fvb4:4409211-4409511", "Fvb4:4064692-4064992",
          "Fvb4:30226449-30226749", "Fvb4:29849830-29850130",
          "Fvb4:22049214-22049514", "Fvb4:19722343-19722643",
          "Fvb4:18867714-18868014", "Fvb4:18059930-18060230",
          "Fvb4:1681027-1681327", "Fvb4:14165900-14166200",
          "Fvb4:13564964-13565264", "Fvb4:13478467-13478767",
          "Fvb4:1141239-1141539", "Fvb3:6084802-6085102",
          "Fvb3:3703850-3704150", "Fvb3:30663755-30664055",
          "Fvb3:23136938-23137238", "Fvb3:22409610-22409910",
          "Fvb3:19002283-19002583", "Fvb3:13624101-13624401",
          "Fvb3:13372258-13372558", "Fvb3:12739719-12740019",
          "Fvb3:11121610-11121910", "Fvb2:4894066-4894366",
          "Fvb2:4887618-4887918", "Fvb2:27383284-27383584",
          "Fvb2:2566519-2566819", "Fvb2:2469625-2469925",
          "Fvb2:18986881-18987181", "Fvb2:18719002-18719302",
          "Fvb2:18455040-18455340", "Fvb2:15159660-15159960",
          "Fvb1:8870165-8870465", "Fvb1:8270327-8270627",
          "Fvb1:6390524-6390824", "Fvb1:3305270-3305570",
          "Fvb1:23653886-23654186", "Fvb1:22957475-22957775",
          "Fvb1:22856807-22857107", "Fvb1:22548106-22548406",
          "Fvb1:22452920-22453220", "Fvb1:21718337-21718637",
          "Fvb1:21308932-21309232", "Fvb1:21276510-21276810",
          "Fvb1:20806467-20806767", "Fvb1:17803287-17803587",
          "Fvb3:499812-500112", "Fvb6:38008083-38008383",
          "Fvb4:19089455-19089755", "Fvb6:24790882-24791182",
          "Fvb6:13780683-13780983", "Fvb3:33882263-33882563",
          "Fvb7:953173-953473", "Fvb4:12491984-12492284",
          "Fvb4:1191955-1192255", "Fvb1:18327720-18328020",
          "Fvb6:10179384-10179684", "Fvb7:14548797-14549097",
          "Fvb6:5398653-5398953", "Fvb5:9934248-9934548",
          "Fvb4:19992901-19993201", "Fvb4:19366431-19366731",
          "Fvb3:14537818-14538118", "Fvb2:18165963-18166263",
          "Fvb1:3854252-3854552", "Fvb1:22953406-22953706",
          "Fvb1:21813237-21813537", "Fvb7:23430212-23430512",
          "Fvb5:14238191-14238491", "Fvb7:15829767-15830067",
          "Fvb5:25368640-25368940", "Fvb2:18520399-18520699",
          "Fvb2:17126232-17126532", "Fvb6:15179147-15179447",
          "Fvb5:11976231-11976531", "Fvb4:9659552-9659852",
          "Fvb4:23054137-23054437", "Fvb4:19334794-19335094",
          "Fvb4:11008724-11009024", "Fvb3:36470520-36470820",
          "Fvb3:25543977-25544277", "Fvb3:15281201-15281501",
          "Fvb3:12614302-12614602", "Fvb2:25217911-25218211",
          "Fvb4:606112-606412", "Fvb4:6343754-6344054",
          "Fvb3:22052461-22052761", "Fvb3:32080431-32080731",
          "Fvb5:6958563-6958863", "Fvb4:28304123-28304423",
          "Fvb6:18437989-18438289", "Fvb6:36585283-36585583",
          "Fvb5:15687014-15687314", "Fvb6:19308294-19308594",
          "Fvb4:31548479-31548779", "Fvb3:2883983-2884283",
          "Fvb3:26077458-26077758", "Fvb1:16887903-16888203",
          "Fvb3:26624980-26625280", "Fvb1:11444462-11444762",
          "Fvb1:16829113-16829413", "Fvb3:31102268-31102568",
          "Fvb6:18720441-18720741", "Fvb5:24642690-24642990",
          "Fvb6:20974356-20974656", "Fvb3:23210827-23211127",
          "Fvb6:7644020-7644320", "Fvb5:7949901-7950201",
          "Fvb5:2967146-2967446", "Fvb4:9184748-9185048",
          "Fvb4:8822079-8822379", "Fvb4:4904757-4905057",
          "Fvb3:6856671-6856971", "Fvb3:11712588-11712888",
          "Fvb2:76342-76642", "Fvb1:5171123-5171423",
          "Fvb1:15054944-15055244", "Fvb7:5237864-5238164",
          "Fvb7:21492175-21492475", "Fvb7:19742143-19742443",
          "Fvb7:10979178-10979478", "Fvb6:6274475-6274775",
          "Fvb6:5071222-5071522", "Fvb6:33058554-33058854",
          "Fvb6:32920328-32920628", "Fvb6:28532895-28533195",
          "Fvb6:27403236-27403536", "Fvb6:16856456-16856756",
          "Fvb6:15893303-15893603", "Fvb6:15496964-15497264",
          "Fvb6:14987859-14988159", "Fvb6:13770155-13770455",
          "Fvb5:9456497-9456797", "Fvb5:7766457-7766757",
          "Fvb5:27803197-27803497", "Fvb5:22705570-22705870",
          "Fvb5:22581945-22582245", "Fvb5:22389827-22390127",
          "Fvb5:2209447-2209747", "Fvb5:21372107-21372407",
          "Fvb5:1816011-1816311", "Fvb5:16158792-16159092",
          "Fvb5:13511374-13511674", "Fvb4:9985375-9985675",
          "Fvb4:9913328-9913628", "Fvb4:9614656-9614956",
          "Fvb4:9301402-9301702", "Fvb4:9147492-9147792",
          "Fvb4:9043567-9043867", "Fvb4:8825639-8825939",
          "Fvb4:6072372-6072672", "Fvb4:30573521-30573821",
          "Fvb4:27221021-27221321", "Fvb4:22945677-22945977",
          "Fvb4:22499322-22499622", "Fvb4:20117684-20117984",
          "Fvb4:19577437-19577737", "Fvb4:18098364-18098664",
          "Fvb4:12961784-12962084", "Fvb4:12385648-12385948",
          "Fvb4:11990676-11990976", "Fvb4:11626908-11627208",
          "Fvb4:11422743-11423043", "Fvb4:1037972-1038272",
          "Fvb4:10249174-10249474", "Fvb3:8828711-8829011",
          "Fvb3:38160281-38160581", "Fvb3:35691870-35692170",
          "Fvb3:35682943-35683243", "Fvb3:33809702-33810002",
          "Fvb3:33439562-33439862", "Fvb3:33241435-33241735",
          "Fvb3:32949261-32949561", "Fvb3:32500252-32500552",
          "Fvb3:31343059-31343359", "Fvb3:27888607-27888907",
          "Fvb3:26424160-26424460", "Fvb3:26105169-26105469",
          "Fvb3:25765028-25765328", "Fvb3:24343659-24343959",
          "Fvb3:23798757-23799057", "Fvb3:2187122-2187422",
          "Fvb3:21722312-21722612", "Fvb3:18542687-18542987",
          "Fvb3:17334227-17334527", "Fvb3:14885636-14885936",
          "Fvb3:14387455-14387755", "Fvb2:7941954-7942254",
          "Fvb2:6644881-6645181", "Fvb2:26777265-26777565",
          "Fvb2:19837789-19838089", "Fvb2:14993220-14993520",
          "Fvb2:14738268-14738568", "Fvb1:8614827-8615127",
          "Fvb1:7363151-7363451", "Fvb1:6754824-6755124",
          "Fvb1:23505019-23505319", "Fvb1:22793848-22794148",
          "Fvb1:21274671-21274971", "Fvb1:21151787-21152087",
          "Fvb1:20498854-20499154", "Fvb1:20416743-20417043",
          "Fvb1:13932925-13933225", "Fvb6:14192358-14192658",
          "Fvb5:5826428-5826728", "Fvb1:10314143-10314443",
          "Fvb5:422659-422959", "Fvb7:5806147-5806447",
          "Fvb7:11136267-11136567", "Fvb5:29178623-29178923",
          "Fvb6:36954298-36954598", "Fvb3:37286420-37286720",
          "Fvb3:24408501-24408801", "Fvb3:36434606-36434906",
          "Fvb7:21685941-21686241", "Fvb3:10298732-10299032",
          "Fvb6:17716453-17716753", "Fvb1:1472514-1472814",
          "Fvb7:12693845-12694145", "Fvb6:6336554-6336854",
          "Fvb4:19326752-19327052", "Fvb5:16756580-16756880",
          "Fvb5:5781078-5781378", "Fvb4:28314429-28314729",
          "Fvb4:21313597-21313897", "Fvb4:10694169-10694469",
          "Fvb3:22429725-22430025", "Fvb7:19073257-19073557",
          "Fvb7:17498295-17498595", "Fvb1:22577036-22577336",
          "Fvb4:1545948-1546248", "Fvb7:2228548-2228848",
          "Fvb7:21527491-21527791", "Fvb7:13443065-13443365",
          "Fvb5:17748722-17749022", "Fvb4:20298322-20298622",
          "Fvb4:13048481-13048781", "Fvb4:12849976-12850276",
          "Fvb3:6930464-6930764", "Fvb3:24602563-24602863",
          "Fvb3:12865792-12866092", "Fvb2:1338221-1338521",
          "Fvb6:22700950-22701250", "Fvb5:22861227-22861527",
          "Fvb7:15390019-15390319", "Fvb5:9009218-9009518",
          "Fvb6:35361686-35361986", "Fvb1:23649720-23650020",
          "Fvb6:18571960-18572260", "Fvb5:7070221-7070521",
          "Fvb3:30985898-30986198", "Fvb1:9592912-9593212",
          "Fvb7:12967409-12967709", "Fvb7:5414165-5414465",
          "Fvb6:17787631-17787931", "Fvb3:20944075-20944375",
          "Fvb1:2159055-2159355", "Fvb2:5735988-5736288",
          "Fvb1:18939085-18939385", "Fvb3:876000-876300",
          "Fvb7:13194240-13194540", "Fvb4:11663097-11663397",
          "Fvb3:31985187-31985487", "Fvb7:23314113-23314413",
          "Fvb5:27564886-27565186", "Fvb4:8500013-8500313",
          "Fvb4:19612811-19613111", "Fvb4:12523825-12524125",
          "Fvb3:21764692-21764992", "Fvb3:13572969-13573269",
          "Fvb2:28043616-28043916", "Fvb1:9436514-9436814",
          "Fvb7:7606213-7606513", "Fvb7:4423512-4423812",
          "Fvb7:22199248-22199548", "Fvb7:16605736-16606036",
          "Fvb7:12206942-12207242", "Fvb7:11514669-11514969",
          "Fvb7:10882438-10882738", "Fvb6:8038697-8038997",
          "Fvb6:68756-69056", "Fvb6:33695407-33695707",
          "Fvb6:31869667-31869967", "Fvb6:31032950-31033250",
          "Fvb6:29109713-29110013", "Fvb6:27519949-27520249",
          "Fvb6:25727406-25727706", "Fvb6:23009646-23009946",
          "Fvb6:21808166-21808466", "Fvb6:15093588-15093888",
          "Fvb6:12951981-12952281", "Fvb5:9397500-9397800",
          "Fvb5:6228837-6229137", "Fvb5:2835317-2835617",
          "Fvb5:24948101-24948401", "Fvb5:2030746-2031046",
          "Fvb5:16437594-16437894", "Fvb5:16409224-16409524",
          "Fvb5:1046398-1046698", "Fvb4:8378550-8378850",
          "Fvb4:7389242-7389542", "Fvb4:7342592-7342892",
          "Fvb4:4835718-4836018", "Fvb4:3307780-3308080",
          "Fvb4:31942106-31942406", "Fvb4:2829334-2829634",
          "Fvb4:24793312-24793612", "Fvb4:24149145-24149445",
          "Fvb4:23810299-23810599", "Fvb4:22851274-22851574",
          "Fvb4:22683297-22683597", "Fvb4:20800287-20800587",
          "Fvb4:19995619-19995919", "Fvb4:19208255-19208555",
          "Fvb4:18993294-18993594", "Fvb4:17054942-17055242",
          "Fvb4:12853484-12853784", "Fvb4:12272783-12273083",
          "Fvb4:11866330-11866630", "Fvb4:1152482-1152782",
          "Fvb4:10991914-10992214", "Fvb4:10770339-10770639",
          "Fvb4:10374539-10374839", "Fvb4:10232962-10233262",
          "Fvb3:47200-47500", "Fvb3:34516860-34517160",
          "Fvb3:3318939-3319239", "Fvb3:3078432-3078732",
          "Fvb3:26914097-26914397", "Fvb3:26727845-26728145",
          "Fvb3:26416540-26416840", "Fvb3:25913100-25913400",
          "Fvb3:25368532-25368832", "Fvb3:24283903-24284203",
          "Fvb3:22422903-22423203", "Fvb3:21377458-21377758",
          "Fvb3:20939464-20939764", "Fvb3:2038430-2038730",
          "Fvb3:17791180-17791480", "Fvb3:17538756-17539056",
          "Fvb3:13862836-13863136", "Fvb3:13545393-13545693",
          "Fvb2:8524649-8524949", "Fvb2:816824-817124",
          "Fvb2:7961980-7962280", "Fvb2:4543558-4543858",
          "Fvb2:29078858-29079158", "Fvb2:28242364-28242664",
          "Fvb2:24844157-24844457", "Fvb2:20574444-20574744",
          "Fvb2:18638663-18638963", "Fvb2:17774473-17774773",
          "Fvb2:12757016-12757316", "Fvb2:11825007-11825307",
          "Fvb2:10197779-10198079", "Fvb2:10095180-10095480",
          "Fvb1:9091653-9091953", "Fvb1:23449258-23449558",
          "Fvb1:23360921-23361221", "Fvb1:22455419-22455719",
          "Fvb1:22329408-22329708", "Fvb1:22291094-22291394",
          "Fvb1:20617635-20617935", "Fvb1:19589195-19589495",
          "Fvb1:19519472-19519772", "Fvb1:19332917-19333217",
          "Fvb1:1691329-1691629", "Fvb1:16410745-16411045",
          "Fvb1:1104609-1104909", "Fvb1:10482046-10482346",
          "Fvb2:27793871-27794171", "Fvb1:108983-109283",
          "Fvb5:10920762-10921062", "Fvb7:1492514-1492814",
          "Fvb4:9765985-9766285", "Fvb4:5584715-5585015",
          "Fvb3:36587551-36587851", "Fvb6:37876772-37877072",
          "Fvb6:22507195-22507495", "Fvb5:25846808-25847108",
          "Fvb4:33327057-33327357", "Fvb5:2987335-2987635",
          "Fvb5:9901874-9902174", "Fvb4:1895930-1896230",
          "Fvb3:19658999-19659299", "Fvb2:16910200-16910500",
          "Fvb5:22488079-22488379", "Fvb4:3022846-3023146",
          "Fvb4:28876845-28877145", "Fvb4:14033383-14033683",
          "Fvb2:20212768-20213068", "Fvb2:11449554-11449854",
          "Fvb1:14056483-14056783", "contig_7:29343-29643",
          "Fvb5:24321625-24321925", "Fvb5:21748766-21749066",
          "Fvb4:16080580-16080880", "Fvb6:25088048-25088348",
          "Fvb4:24649595-24649895", "Fvb4:18417785-18418085",
          "Fvb7:1711442-1711742", "Fvb3:23783628-23783928",
          "Fvb7:8433550-8433850", "Fvb7:6930826-6931126",
          "Fvb7:6831137-6831437", "Fvb6:19227334-19227634",
          "Fvb5:9835152-9835452", "Fvb5:23004488-23004788",
          "Fvb3:6668542-6668842", "Fvb3:37726386-37726686",
          "Fvb3:25565854-25566154", "Fvb3:20735268-20735568",
          "Fvb2:10047985-10048285", "Fvb1:19549683-19549983",
          "Fvb4:1547510-1547810", "Fvb3:994727-995027",
          "Fvb5:6281854-6282154", "Fvb4:33837882-33838182",
          "Fvb4:851430-851730", "Fvb4:30432143-30432443",
          "Fvb1:20423959-20424259", "Fvb4:3483183-3483483",
          "Fvb6:4068579-4068879", "Fvb6:4037011-4037311",
          "Fvb5:23393137-23393437", "Fvb4:25792788-25793088",
          "Fvb4:18972780-18973080", "Fvb3:29614878-29615178",
          "Fvb6:18172555-18172855", "Fvb2:8208769-8209069",
          "Fvb4:33425873-33426173", "Fvb4:10950757-10951057",
          "Fvb6:10647950-10648250", "Fvb3:23201208-23201508",
          "Fvb6:1697999-1698299", "Fvb5:9781170-9781470",
          "Fvb4:21915812-21916112", "Fvb7:10301910-10302210",
          "Fvb5:22463782-22464082", "Fvb5:14990507-14990807",
          "Fvb4:8607901-8608201", "Fvb4:6546493-6546793",
          "Fvb4:13960700-13961000", "Fvb4:11342047-11342347",
          "Fvb4:10088442-10088742", "Fvb2:6928062-6928362",
          "Fvb2:20885120-20885420", "Fvb3:11626100-11626400",
          "Fvb7:5494267-5494567", "Fvb5:5956014-5956314",
          "Fvb3:33034566-33034866", "Fvb3:29326056-29326356",
          "Fvb3:23372311-23372611", "Fvb2:24484062-24484362"
        ],
        "motifs": [
          {
            "db": 0,
            "id": "TGSRRGTGGGCCCCRC",
            "alt": "MEME-1",
            "consensus": "TGSRRGTGGGCCCCRC",
            "len": 16,
            "motif_evalue": "6.0e-3027",
            "motif_nsites": 2826,
            "n_tested": 142,
            "score_threshold": 5,
            "pwm": [
              [0.106517, 0.0821, 0.262915, 0.548468], 
              [0.187901, 0.0750232, 0.556959, 0.180116], 
              [0.159947, 0.258668, 0.457883, 0.123501], 
              [0.555899, 0.0704234, 0.278483, 0.0951944], 
              [0.294054, 0.0594538, 0.492559, 0.153932], 
              [0.0753791, 0.0332697, 0.870111, 0.0212401], 
              [9.80857e-06, 0.0304388, 0.0187612, 0.95079], 
              [0.00991746, 7.88366e-06, 0.990065, 9.80857e-06], 
              [9.80857e-06, 7.88366e-06, 0.999972, 9.80857e-06], 
              [0.132348, 0.00354676, 0.616405, 0.247701], 
              [0.0824559, 0.672666, 0.0594538, 0.185424], 
              [9.80857e-06, 0.993957, 7.88366e-06, 0.0060256], 
              [9.80857e-06, 0.999972, 7.88366e-06, 9.80857e-06], 
              [9.80857e-06, 0.981572, 7.88366e-06, 0.0184102], 
              [0.516623, 0.0212381, 0.429222, 0.0329176], 
              [0.0180562, 0.886389, 0.026192, 0.0693634]
            ],
            "total_sites": 2914,
            "sites": [
              0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 1, 0, 2, 1, 0, 0, 1, 0.5, 0,
              0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 4, 0, 0, 2, 0, 3, 3.5, 1, 1, 2,
              0, 3, 3, 3, 2, 3, 1, 3, 3, 1, 1, 1, 2, 1, 0, 0, 3, 2, 1, 3, 4.5,
              1, 1, 2, 2, 1, 3, 2, 5, 2.5, 2, 2, 5, 5, 4.5, 5, 9, 9, 7, 10.5,
              11, 6.5, 16, 12, 11, 22, 33, 27, 30, 42.5, 48, 68, 65, 86, 106,
              125, 160, 179.5, 163, 155.5, 168, 170, 160.5, 115.5, 119.5, 85,
              58, 58, 53, 52, 36, 32, 24, 27, 19, 15, 12, 14, 10, 8, 5, 5, 8,
              4, 10, 6, 8, 5, 4, 6, 0, 0, 1.5, 1, 4, 3, 2, 0, 2, 1, 1.5, 2, 3,
              2, 2, 1, 1, 1, 1, 3, 2, 2, 2, 2, 0, 2, 5, 3, 1, 1, 3, 1, 2, 2,
              1, 4, 1, 0, 2, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0,
              2, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1.5, 0, 0, 0, 0, 0, 1, 0, 0,
              1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0,
              1, 0, 0, 2, 1, 1, 0, 0, 0, 0, 2, 0, 0, 0
            ],
            "seqs": [
              3, 6, 7, 9, 10, 12, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25,
              26, 27, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43,
              44, 45, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60,
              61, 62, 63, 65, 66, 67, 68, 69, 70, 72, 73, 74, 76, 77, 78, 79,
              81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
              97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
              110, 111, 112, 113, 114, 115, 116, 117, 119, 121, 122, 123, 125,
              126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
              139, 140, 141, 142, 143, 144, 146, 147, 148, 149, 150, 151, 152,
              153, 154, 155, 156, 157, 158, 159, 160, 162, 163, 164, 165, 166,
              167, 168, 169, 170, 171, 173, 174, 175, 176, 177, 178, 179, 180,
              181, 182, 183, 185, 186, 188, 189, 190, 192, 193, 195, 196, 197,
              198, 199, 200, 201, 202, 203, 204, 205, 206, 208, 209, 210, 211,
              212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 223, 224, 225,
              226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 237, 238, 239,
              240, 241, 242, 243, 244, 245, 246, 248, 249, 250, 251, 252, 253,
              254, 255, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267,
              269, 270, 271, 272, 273, 274, 276, 277, 278, 279, 280, 281, 282,
              283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295,
              296, 297, 299, 300, 301, 302, 303, 305, 307, 308, 309, 310, 311,
              312, 313, 315, 316, 317, 318, 320, 322, 323, 324, 325, 326, 327,
              328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340,
              341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353,
              354, 355, 356, 357, 358, 360, 361, 363, 364, 365, 366, 367, 368,
              369, 370, 371, 372, 373, 374, 375, 376, 377, 379, 380, 381, 382,
              383, 385, 386, 387, 389, 390, 391, 394, 395, 396, 397, 398, 399,
              400, 401, 402, 403, 404, 406, 407, 408, 410, 412, 413, 414, 415,
              417, 418, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430,
              431, 433, 434, 435, 436, 437, 438, 439, 440, 441, 443, 444, 445,
              446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 458, 459,
              460, 461, 462, 463, 464, 465, 466, 467, 468, 470, 471, 472, 473,
              474, 475, 476, 480, 481, 482, 483, 486, 487, 488, 489, 490, 491,
              492, 493, 494, 495, 496, 498, 499, 500, 501, 502, 503, 504, 505,
              506, 507, 508, 509, 510, 511, 513, 515, 516, 517, 518, 519, 520,
              521, 522, 523, 524, 525, 526, 527, 529, 530, 531, 532, 533, 534,
              535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 546, 547, 548,
              549, 550, 551, 553, 554, 555, 556, 557, 558, 559, 560, 562, 563,
              564, 565, 566, 568, 569, 570, 571, 572, 573, 574, 576, 577, 578,
              579, 580, 581, 582, 583, 586, 587, 588, 589, 590, 591, 592, 593,
              594, 597, 598, 599, 601, 602, 603, 604, 605, 606, 607, 608, 609,
              610, 611, 612, 613, 614, 615, 617, 618, 619, 620, 621, 622, 623,
              624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636,
              637, 638, 639, 640, 642, 643, 644, 645, 646, 647, 648, 649, 650,
              651, 652, 654, 656, 657, 658, 659, 661, 662, 663, 664, 665, 666,
              667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 680,
              682, 683, 684, 685, 686, 687, 688, 689, 690, 692, 693, 694, 695,
              696, 697, 698, 699, 700, 701, 703, 704, 705, 707, 708, 709, 710,
              711, 712, 713, 714, 715, 716, 717, 718, 719, 723, 724, 725, 726,
              727, 728, 729, 731, 732, 733, 734, 735, 736, 738, 739, 740, 741,
              742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754,
              755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767,
              768, 769, 770, 771, 772, 774, 775, 777, 778, 779, 780, 781, 782,
              783, 785, 786, 787, 789, 790, 791, 792, 793, 794, 795, 796, 797,
              798, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813,
              814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826,
              828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 840, 841,
              842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854,
              855, 856, 857, 858, 860, 863, 864, 866, 869, 870, 871, 872, 873,
              874, 875, 876, 877, 878, 879, 880, 881, 883, 884, 885, 886, 887,
              889, 890, 891, 892, 893, 894, 895, 897, 898, 899, 900, 901, 902,
              903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915,
              916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928,
              929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941,
              942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954,
              955, 957, 958, 959, 960, 962, 965, 966, 967, 969, 970, 971, 972,
              973, 974, 976, 977, 978, 979, 980, 982, 984, 985, 986, 987, 988,
              989, 991, 994, 995, 996, 997, 998, 999, 1000, 1002, 1003, 1004,
              1005, 1006, 1008, 1010, 1011, 1013, 1014, 1015, 1016, 1018,
              1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028,
              1029, 1031, 1032, 1033, 1035, 1036, 1037, 1038, 1039, 1040,
              1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050,
              1051, 1052, 1053, 1054, 1056, 1059, 1060, 1062, 1064, 1065,
              1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075,
              1076, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087,
              1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1098,
              1099, 1100, 1101, 1104, 1105, 1106, 1107, 1108, 1109, 1110,
              1111, 1112, 1115, 1116, 1117, 1118, 1119, 1121, 1122, 1123,
              1124, 1125, 1126, 1127, 1128, 1129, 1131, 1134, 1136, 1138,
              1139, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149,
              1150, 1151, 1152, 1153, 1154, 1156, 1157, 1158, 1161, 1162,
              1163, 1164, 1165, 1166, 1167, 1168, 1169, 1171, 1172, 1173,
              1174, 1175, 1176, 1178, 1180, 1181, 1182, 1183, 1184, 1186,
              1187, 1188, 1189, 1192, 1193, 1194, 1195, 1196, 1197, 1198,
              1199, 1200, 1202, 1203, 1204, 1205, 1206, 1207, 1209, 1210,
              1211, 1212, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221,
              1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231,
              1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1241, 1242,
              1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1254,
              1255, 1256, 1257, 1259, 1261, 1262, 1263, 1264, 1265, 1268,
              1269, 1270, 1271, 1273, 1274, 1275, 1276, 1277, 1278, 1279,
              1280, 1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289,
              1290, 1291, 1292, 1293, 1296, 1297, 1298, 1299, 1300, 1301,
              1302, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312,
              1313, 1314, 1315, 1316, 1317, 1318, 1319, 1321, 1322, 1323,
              1324, 1325, 1326, 1328, 1329, 1330, 1331, 1332, 1334, 1335,
              1336, 1337, 1338, 1339, 1341, 1342, 1343, 1344, 1345, 1346,
              1347, 1348, 1350, 1351, 1352, 1354, 1355, 1356, 1357, 1358,
              1359, 1360, 1361, 1362, 1363, 1364, 1365, 1366, 1367, 1368,
              1369, 1370, 1371, 1372, 1374, 1375, 1376, 1377, 1378, 1379,
              1380, 1381, 1382, 1383, 1384, 1386, 1388, 1389, 1390, 1391,
              1392, 1393, 1394, 1396, 1397, 1398, 1399, 1400, 1401, 1402,
              1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414,
              1415, 1416, 1417, 1418, 1419, 1423, 1424, 1425, 1427, 1428,
              1430, 1431, 1432, 1433, 1434, 1435, 1437, 1438, 1439, 1440,
              1441, 1442, 1443, 1444, 1445, 1448, 1449, 1450, 1451, 1452,
              1454, 1455, 1456, 1457, 1458, 1459, 1461, 1462, 1464, 1465,
              1466, 1467, 1468, 1470, 1471, 1472, 1473, 1474, 1476, 1477,
              1478, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 1488, 1489,
              1490, 1491, 1492, 1494, 1495, 1496, 1497, 1498, 1499, 1501,
              1502, 1503, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512,
              1513, 1514, 1515, 1517, 1518, 1519, 1520, 1521, 1522, 1523,
              1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533,
              1534, 1535, 1537, 1538, 1539, 1541, 1542, 1543, 1545, 1546,
              1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 1556, 1557,
              1558, 1559, 1560, 1561, 1562, 1564, 1565, 1566, 1567, 1568,
              1569, 1570, 1571, 1573, 1574, 1575, 1576, 1577, 1578, 1579,
              1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590,
              1592, 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601,
              1602, 1603, 1604, 1605, 1607, 1608, 1609, 1611, 1612, 1613,
              1615, 1616, 1617, 1618, 1619, 1620, 1622, 1623, 1624, 1625,
              1626, 1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 1635,
              1636, 1637, 1638, 1639, 1640, 1641, 1642, 1644, 1645, 1646,
              1647, 1648, 1649, 1650, 1651, 1652, 1654, 1656, 1657, 1658,
              1659, 1661, 1663, 1664, 1665, 1667, 1669, 1670, 1674, 1676,
              1677, 1679, 1680, 1682, 1683, 1685, 1686, 1687, 1688, 1690,
              1691, 1692, 1694, 1696, 1697, 1698, 1699, 1700, 1701, 1702,
              1704, 1705, 1708, 1709, 1710, 1711, 1712, 1713, 1714, 1715,
              1716, 1717, 1718, 1719, 1720, 1722, 1723, 1724, 1725, 1726,
              1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736,
              1737, 1738, 1741, 1742, 1743, 1744, 1746, 1747, 1748, 1750,
              1752, 1753, 1754, 1755, 1756, 1757, 1759, 1761, 1762, 1763,
              1765, 1766, 1768, 1769, 1770, 1772, 1773, 1775, 1776, 1777,
              1778, 1780, 1781, 1782, 1783, 1784, 1786, 1787, 1788, 1790,
              1791, 1792, 1793, 1794, 1795, 1796, 1799, 1801, 1802, 1803,
              1804, 1805, 1806, 1807, 1808, 1810, 1811, 1813, 1815, 1816,
              1817, 1818, 1819, 1820, 1821, 1822, 1823, 1826, 1828, 1829,
              1830, 1831, 1832, 1834, 1835, 1836, 1838, 1840, 1841, 1842,
              1843, 1844, 1845, 1848, 1849, 1850, 1851, 1852, 1853, 1854,
              1855, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865,
              1866, 1867, 1869, 1870, 1871, 1872, 1873, 1874, 1875, 1876,
              1877, 1878, 1880, 1882, 1883, 1886, 1888, 1889, 1890, 1892,
              1893, 1894, 1895, 1896, 1897, 1898, 1899, 1901, 1902, 1904,
              1905, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915,
              1916, 1917, 1918, 1919, 1925, 1926, 1927, 1928, 1930, 1931,
              1933, 1934, 1935, 1936, 1938, 1939, 1940, 1941, 1942, 1943,
              1944, 1945, 1946, 1948, 1949, 1950, 1952, 1953, 1954, 1955,
              1959, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1971,
              1972, 1974, 1975, 1976, 1977, 1981, 1985, 1986, 1987, 1988,
              1990, 1992, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
              2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,
              2014, 2015, 2016, 2017, 2019, 2020, 2021, 2023, 2024, 2025,
              2026, 2027, 2029, 2030, 2031, 2032, 2033, 2034, 2036, 2037,
              2038, 2039, 2040, 2041, 2042, 2044, 2045, 2046, 2047, 2048,
              2049, 2051, 2052, 2053, 2054, 2055, 2057, 2058, 2059, 2062,
              2063, 2064, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2076,
              2079, 2080, 2081, 2086, 2088, 2089, 2090, 2091, 2093, 2097,
              2098, 2100, 2101, 2104, 2105, 2106, 2107, 2109, 2113, 2114,
              2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 2126, 2127,
              2128, 2129, 2130, 2131, 2132, 2133, 2135, 2136, 2137, 2138,
              2139, 2140, 2141, 2142, 2143, 2144, 2145, 2146, 2148, 2151,
              2152, 2154, 2155, 2157, 2160, 2161, 2162, 2163, 2164, 2166,
              2167, 2168, 2169, 2171, 2172, 2173, 2175, 2177, 2178, 2179,
              2180, 2184, 2185, 2186, 2187, 2190, 2192, 2193, 2194, 2197,
              2198, 2201, 2202, 2203, 2208, 2209, 2210, 2211, 2212, 2213,
              2214, 2215, 2216, 2219, 2220, 2221, 2223, 2224, 2225, 2226,
              2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 2235, 2236,
              2237, 2239, 2240, 2241, 2244, 2245, 2246, 2247, 2248, 2252,
              2254, 2255, 2256, 2257, 2258, 2259, 2261, 2263, 2264, 2267,
              2269, 2271, 2272, 2273, 2274, 2275, 2276, 2278, 2279, 2280,
              2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290,
              2292, 2293, 2294, 2295, 2297, 2298, 2299, 2300, 2301, 2303,
              2304, 2305, 2306, 2308, 2309, 2310, 2311, 2312, 2313, 2314,
              2315, 2316, 2317, 2318, 2319, 2321, 2322, 2323, 2324, 2325,
              2327, 2328, 2329, 2330, 2331, 2332, 2333, 2335, 2336, 2337,
              2338, 2340, 2342, 2344, 2347, 2348, 2349, 2350, 2351, 2352,
              2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362,
              2363, 2365, 2366, 2367, 2368, 2369, 2370, 2372, 2373, 2374,
              2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2385, 2387,
              2388, 2389, 2390, 2391, 2392, 2393, 2394, 2396, 2397, 2398,
              2399, 2400, 2401, 2402, 2403, 2404, 2405, 2407, 2409, 2410,
              2412, 2413, 2414, 2416, 2418, 2419, 2420, 2421, 2422, 2423,
              2424, 2425, 2426, 2427, 2428, 2429, 2430, 2432, 2434, 2435,
              2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 2445, 2446,
              2447, 2448, 2450, 2453, 2454, 2455, 2456, 2457, 2458, 2459,
              2462, 2463, 2464, 2465, 2467, 2469, 2471, 2472, 2473, 2476,
              2477, 2479, 2481, 2482, 2484, 2487, 2488, 2489, 2491, 2492,
              2493, 2494, 2495, 2496, 2497, 2499, 2501, 2502, 2504, 2505,
              2506, 2507, 2508, 2510, 2511, 2512, 2516, 2517, 2519, 2522,
              2523, 2524, 2525, 2526, 2527, 2528, 2529, 2534, 2536, 2537,
              2539, 2542, 2543, 2544, 2545, 2547, 2549, 2550, 2551, 2553,
              2554, 2556, 2558, 2559, 2562, 2563, 2564, 2566, 2567, 2568,
              2569, 2570, 2571, 2574, 2575, 2576, 2577, 2579, 2580, 2584,
              2585, 2586, 2587, 2589, 2590, 2591, 2593, 2594, 2596, 2600,
              2601, 2602, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611,
              2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2624, 2625,
              2628, 2629, 2630, 2631, 2633, 2636, 2637, 2638, 2640, 2641,
              2642, 2644, 2645, 2646, 2647, 2648, 2651, 2653, 2654, 2655,
              2656, 2658, 2659, 2660, 2661, 2664, 2665, 2670, 2671, 2673,
              2674, 2675, 2676, 2677, 2678, 2679, 2683, 2686, 2687, 2689,
              2691, 2692, 2693, 2695, 2696, 2697, 2698, 2700, 2703, 2704,
              2705, 2706, 2707, 2708, 2709, 2710, 2711, 2713, 2715, 2716,
              2717, 2718, 2719, 2721, 2723, 2726, 2728, 2729, 2731, 2733,
              2735, 2736, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 2747,
              2748, 2749, 2754, 2755, 2758, 2759, 2762, 2764, 2766, 2767,
              2768, 2769, 2772, 2773, 2774, 2778, 2780, 2783, 2784, 2785,
              2786, 2787, 2788, 2789, 2790, 2792, 2793, 2795, 2796, 2797,
              2798, 2800, 2801, 2802, 2803, 2804, 2806, 2807, 2809, 2810,
              2811, 2812, 2813, 2814, 2816, 2817, 2819, 2821, 2822, 2823,
              2824, 2826, 2827, 2828, 2829, 2831, 2833, 2834, 2835, 2836,
              2837, 2839, 2842, 2843, 2845, 2846, 2847, 2849, 2850, 2852,
              2853, 2854, 2855, 2858, 2861, 2862, 2864, 2865, 2868, 2869,
              2871, 2873, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2884,
              2885, 2886, 2887, 2889, 2891, 2892, 2893, 2894, 2895, 2896,
              2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904, 2905, 2906,
              2907, 2908, 2912, 2914, 2916, 2917, 2919, 2920, 2921, 2922,
              2923, 2924, 2925, 2926, 2927, 2928, 2930, 2931, 2934, 2935,
              2936, 2937, 2938, 2942, 2943, 2944, 2945, 2946, 2947, 2950,
              2952, 2954, 2955, 2957, 2958, 2959, 2961, 2964, 2965, 2966,
              2967, 2969, 2970, 2972, 2973, 2974, 2975, 2978, 2979, 2980,
              2982, 2983, 2984, 2987, 2989, 2990, 2992, 2993, 2994, 2995,
              2996, 2997, 2998, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 27,
                "sites": 2418,
                "log_adj_pvalue": -4417.27
              }
            ]
          }, {
            "db": 0,
            "id": "CCCACCCCGAATTTC",
            "alt": "MEME-2",
            "consensus": "CCCACCCCGAATTTC",
            "len": 15,
            "motif_evalue": "6.7e-1223",
            "motif_nsites": 869,
            "n_tested": 142,
            "score_threshold": 5,
            "pwm": [
              [0.0103877, 0.90556, 0.0690627, 0.0149902], 
              [3.18951e-05, 0.963091, 0.00232637, 0.0345499], 
              [3.18951e-05, 0.883698, 2.56357e-05, 0.116245], 
              [0.973453, 2.56357e-05, 0.0264896, 3.18951e-05], 
              [0.0069351, 0.933175, 2.56357e-05, 0.059864], 
              [0.00233263, 0.974597, 2.56357e-05, 0.0230442], 
              [0.00233263, 0.948133, 2.56357e-05, 0.0495082], 
              [0.00923684, 0.909012, 2.56357e-05, 0.0817255], 
              [0.188733, 0.00232637, 0.808909, 3.18951e-05], 
              [0.87565, 2.56357e-05, 0.124292, 3.18951e-05], 
              [0.996465, 2.56357e-05, 2.56357e-05, 0.0034835], 
              [0.0069351, 0.0656111, 2.56357e-05, 0.927428], 
              [3.18951e-05, 2.56357e-05, 2.56357e-05, 0.999917], 
              [3.18951e-05, 2.56357e-05, 2.56357e-05, 0.999917], 
              [3.18951e-05, 0.929723, 2.56357e-05, 0.0702198]
            ],
            "total_sites": 1112,
            "sites": [
              1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1,
              0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0,
              2, 3, 0, 2, 2, 0, 3, 4, 3, 2, 8, 2, 8, 4, 9, 11, 10, 16, 21, 21,
              25, 28, 28, 22, 20, 34, 27, 15, 13, 17, 17, 9, 9, 10, 9, 6, 5,
              4, 3, 5, 4, 7, 4, 11, 9, 7, 4, 6, 7, 2, 3, 1, 2, 2, 0, 1, 1, 3,
              1, 4, 3, 1, 1, 4, 1, 4, 2, 0, 6, 3, 1, 3, 9, 3, 10, 5, 6, 8, 7,
              4, 2, 2, 4, 7, 6, 11, 13, 8, 8, 10, 19, 18, 20, 22, 25, 33, 25,
              26, 26, 27, 29, 26, 15, 12, 10, 10, 3, 10, 10, 5, 7, 5, 7, 6, 3,
              3, 4, 1, 1, 1, 0, 0, 2, 0, 3, 0, 3, 0, 0, 1, 0, 0, 0, 1, 2, 1,
              1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 0, 0
            ],
            "seqs": [
              12, 13, 21, 24, 26, 44, 51, 63, 67, 74, 90, 97, 102, 104, 114,
              117, 119, 129, 133, 142, 156, 163, 178, 179, 180, 181, 186, 188,
              199, 204, 221, 241, 244, 245, 249, 266, 276, 277, 286, 290, 291,
              294, 302, 303, 308, 319, 323, 325, 326, 330, 334, 335, 336, 342,
              344, 345, 350, 353, 358, 364, 380, 384, 385, 395, 413, 423, 429,
              431, 434, 437, 440, 441, 443, 446, 456, 457, 464, 470, 475, 486,
              487, 492, 499, 510, 513, 529, 530, 531, 534, 535, 542, 544, 546,
              554, 559, 561, 565, 571, 580, 581, 588, 601, 602, 604, 610, 612,
              618, 619, 622, 624, 626, 630, 633, 636, 640, 642, 644, 650, 658,
              663, 666, 667, 676, 680, 685, 686, 687, 688, 689, 690, 693, 694,
              705, 713, 716, 717, 718, 719, 724, 725, 741, 744, 750, 752, 753,
              756, 757, 758, 759, 760, 762, 765, 766, 767, 771, 779, 782, 799,
              800, 804, 806, 807, 808, 812, 816, 817, 820, 822, 823, 826, 830,
              831, 832, 839, 848, 849, 853, 856, 858, 859, 862, 863, 871, 880,
              882, 885, 886, 887, 889, 890, 891, 900, 903, 907, 917, 918, 919,
              923, 926, 927, 932, 937, 942, 944, 952, 954, 955, 959, 963, 964,
              966, 967, 971, 980, 982, 985, 986, 996, 1001, 1007, 1014, 1015,
              1019, 1023, 1029, 1030, 1031, 1034, 1037, 1038, 1039, 1040,
              1043, 1047, 1048, 1051, 1060, 1065, 1079, 1080, 1081, 1083,
              1085, 1091, 1092, 1101, 1102, 1104, 1109, 1110, 1111, 1113,
              1115, 1121, 1123, 1124, 1125, 1126, 1130, 1131, 1139, 1141,
              1144, 1148, 1150, 1157, 1160, 1163, 1165, 1169, 1170, 1171,
              1176, 1177, 1179, 1182, 1187, 1189, 1192, 1194, 1204, 1205,
              1208, 1211, 1219, 1221, 1223, 1224, 1227, 1228, 1231, 1232,
              1233, 1235, 1236, 1238, 1242, 1243, 1244, 1246, 1247, 1248,
              1255, 1256, 1257, 1259, 1262, 1263, 1265, 1268, 1271, 1275,
              1277, 1278, 1279, 1282, 1284, 1285, 1286, 1293, 1299, 1301,
              1304, 1306, 1307, 1308, 1309, 1310, 1313, 1315, 1316, 1326,
              1328, 1331, 1332, 1339, 1342, 1343, 1344, 1346, 1347, 1348,
              1350, 1357, 1360, 1361, 1363, 1365, 1366, 1367, 1369, 1370,
              1384, 1388, 1391, 1394, 1395, 1396, 1401, 1407, 1408, 1415,
              1427, 1429, 1433, 1435, 1437, 1438, 1441, 1444, 1445, 1446,
              1449, 1450, 1451, 1452, 1453, 1454, 1455, 1457, 1459, 1468,
              1469, 1471, 1473, 1477, 1490, 1491, 1497, 1505, 1506, 1507,
              1514, 1516, 1521, 1523, 1524, 1525, 1526, 1529, 1537, 1540,
              1543, 1545, 1546, 1547, 1553, 1556, 1558, 1559, 1562, 1564,
              1566, 1567, 1568, 1569, 1570, 1571, 1572, 1580, 1582, 1584,
              1585, 1589, 1590, 1591, 1592, 1594, 1596, 1600, 1601, 1603,
              1604, 1605, 1606, 1607, 1608, 1609, 1614, 1615, 1616, 1617,
              1624, 1626, 1627, 1629, 1633, 1634, 1640, 1646, 1650, 1653,
              1655, 1656, 1657, 1660, 1663, 1668, 1669, 1672, 1673, 1679,
              1682, 1683, 1684, 1685, 1686, 1687, 1688, 1689, 1690, 1694,
              1696, 1697, 1699, 1700, 1704, 1705, 1708, 1719, 1720, 1722,
              1726, 1727, 1730, 1735, 1736, 1737, 1742, 1744, 1745, 1747,
              1753, 1756, 1761, 1766, 1768, 1769, 1773, 1775, 1776, 1778,
              1779, 1780, 1781, 1782, 1783, 1786, 1787, 1788, 1789, 1790,
              1793, 1795, 1796, 1798, 1801, 1802, 1806, 1807, 1808, 1813,
              1814, 1815, 1816, 1822, 1823, 1825, 1826, 1827, 1832, 1834,
              1837, 1841, 1842, 1846, 1847, 1850, 1851, 1852, 1859, 1862,
              1866, 1869, 1870, 1872, 1874, 1879, 1881, 1882, 1883, 1884,
              1885, 1886, 1898, 1902, 1906, 1909, 1910, 1911, 1913, 1921,
              1924, 1925, 1927, 1929, 1930, 1931, 1935, 1938, 1942, 1944,
              1945, 1946, 1947, 1948, 1949, 1951, 1953, 1954, 1955, 1956,
              1957, 1958, 1959, 1964, 1965, 1966, 1967, 1968, 1971, 1976,
              1981, 1983, 1986, 1996, 1997, 1999, 2000, 2001, 2002, 2008,
              2011, 2013, 2014, 2021, 2029, 2033, 2035, 2036, 2038, 2041,
              2044, 2045, 2046, 2052, 2058, 2060, 2062, 2064, 2066, 2071,
              2072, 2073, 2079, 2083, 2086, 2087, 2089, 2093, 2094, 2096,
              2097, 2098, 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107,
              2109, 2112, 2114, 2115, 2116, 2117, 2119, 2122, 2123, 2128,
              2132, 2133, 2134, 2136, 2138, 2145, 2147, 2152, 2155, 2158,
              2160, 2161, 2165, 2166, 2167, 2168, 2169, 2171, 2176, 2177,
              2179, 2180, 2181, 2186, 2193, 2197, 2199, 2203, 2206, 2207,
              2211, 2212, 2213, 2214, 2218, 2219, 2222, 2223, 2226, 2227,
              2229, 2230, 2231, 2232, 2234, 2235, 2236, 2237, 2238, 2239,
              2242, 2243, 2244, 2245, 2246, 2247, 2248, 2251, 2255, 2256,
              2257, 2259, 2260, 2261, 2262, 2268, 2271, 2272, 2276, 2278,
              2279, 2284, 2285, 2288, 2293, 2294, 2295, 2297, 2300, 2304,
              2305, 2306, 2317, 2318, 2321, 2322, 2325, 2327, 2332, 2333,
              2335, 2336, 2337, 2340, 2343, 2345, 2346, 2354, 2357, 2359,
              2365, 2366, 2367, 2369, 2372, 2374, 2375, 2376, 2377, 2383,
              2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394,
              2395, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2407, 2410,
              2412, 2413, 2414, 2415, 2416, 2420, 2421, 2425, 2426, 2427,
              2428, 2429, 2432, 2435, 2437, 2438, 2443, 2445, 2447, 2452,
              2453, 2454, 2455, 2456, 2457, 2459, 2461, 2462, 2467, 2469,
              2471, 2476, 2477, 2481, 2486, 2487, 2495, 2497, 2499, 2501,
              2506, 2509, 2510, 2519, 2520, 2525, 2528, 2532, 2533, 2534,
              2535, 2536, 2538, 2541, 2542, 2543, 2544, 2545, 2546, 2547,
              2550, 2551, 2552, 2553, 2556, 2557, 2558, 2561, 2562, 2564,
              2566, 2567, 2572, 2573, 2574, 2578, 2582, 2584, 2585, 2586,
              2587, 2588, 2589, 2590, 2591, 2595, 2596, 2597, 2599, 2600,
              2602, 2605, 2606, 2607, 2611, 2614, 2615, 2616, 2619, 2620,
              2621, 2623, 2624, 2626, 2630, 2631, 2636, 2638, 2642, 2644,
              2650, 2651, 2653, 2655, 2656, 2667, 2668, 2671, 2673, 2675,
              2676, 2677, 2680, 2681, 2682, 2683, 2687, 2688, 2689, 2690,
              2691, 2692, 2694, 2701, 2703, 2704, 2705, 2706, 2707, 2708,
              2710, 2711, 2712, 2713, 2719, 2721, 2723, 2724, 2726, 2728,
              2730, 2731, 2732, 2738, 2741, 2743, 2744, 2745, 2746, 2747,
              2749, 2758, 2770, 2775, 2777, 2782, 2783, 2785, 2786, 2787,
              2789, 2807, 2808, 2810, 2811, 2813, 2815, 2817, 2818, 2819,
              2822, 2823, 2824, 2827, 2832, 2833, 2834, 2835, 2836, 2837,
              2840, 2841, 2842, 2843, 2844, 2845, 2846, 2847, 2850, 2851,
              2852, 2853, 2855, 2856, 2857, 2859, 2861, 2862, 2863, 2864,
              2865, 2866, 2867, 2868, 2869, 2870, 2871, 2873, 2874, 2875,
              2876, 2877, 2878, 2879, 2880, 2881, 2884, 2885, 2886, 2888,
              2889, 2890, 2891, 2895, 2896, 2901, 2903, 2904, 2905, 2907,
              2908, 2909, 2910, 2912, 2914, 2919, 2932, 2933, 2935, 2938,
              2942, 2946, 2947, 2948, 2950, 2952, 2954, 2958, 2959, 2965,
              2966, 2969, 2971, 2973, 2977, 2978, 2979, 2984, 2985, 2986,
              2988, 2989, 2990, 2992, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 110,
                "sites": 1057,
                "log_adj_pvalue": -815.61
              }
            ]
          }, {
            "db": 0,
            "id": "TTTTCGGTAAATTTT",
            "alt": "MEME-3",
            "consensus": "TTTTCGGTAAATTTT",
            "len": 15,
            "motif_evalue": "3.1e-1194",
            "motif_nsites": 949,
            "n_tested": 142,
            "score_threshold": 5,
            "pwm": [
              [0.135948, 0.0105594, 2.34749e-05, 0.853469], 
              [2.92066e-05, 2.34749e-05, 0.00423803, 0.995709], 
              [2.92066e-05, 0.0105594, 2.34749e-05, 0.989388], 
              [0.0168874, 2.34749e-05, 0.00318414, 0.979905], 
              [0.0179413, 0.791299, 0.00423803, 0.186522], 
              [0.285563, 2.34749e-05, 0.699634, 0.0147797], 
              [0.040067, 2.34749e-05, 0.95988, 2.92066e-05], 
              [2.92066e-05, 2.34749e-05, 0.00529192, 0.994655], 
              [0.947242, 0.00318414, 0.0358467, 0.0137268], 
              [0.860844, 2.34749e-05, 0.102226, 0.0369063], 
              [0.930384, 2.34749e-05, 2.34749e-05, 0.0695689], 
              [0.233935, 0.107494, 2.34749e-05, 0.658548], 
              [2.92066e-05, 0.013721, 2.34749e-05, 0.986226], 
              [0.0010831, 0.121191, 2.34749e-05, 0.877703], 
              [0.00635054, 0.00529192, 2.34749e-05, 0.988334]
            ],
            "total_sites": 1169,
            "sites": [
              0, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0,
              1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0.5, 0, 1, 1, 0, 0, 0, 0, 0, 0, 2,
              0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0.5, 0, 2, 1, 0, 2, 0, 3, 2,
              0, 2, 2, 2, 4, 3, 2, 2, 2, 1, 2, 1, 1, 2, 0, 2, 1, 0, 0, 1, 2,
              0, 3, 2, 1, 1, 2, 1, 0, 1, 0.5, 4, 2, 0, 1, 2, 2, 2, 2, 4, 6, 0,
              3, 1, 1, 4, 6.5, 6, 11.5, 8, 11, 16, 10, 20, 20, 19, 26, 22,
              40.5, 19, 28.5, 26, 27, 30, 25, 16, 13, 8, 11, 5, 10.5, 8, 7, 4,
              5, 6, 5, 4, 3, 2, 4, 2, 2, 3.5, 0, 5, 3, 7, 3, 10, 2, 8, 5, 8,
              9, 12, 19, 24, 23, 26.5, 29.5, 28, 20, 18, 31.5, 32, 13, 14, 16,
              14.5, 15, 13.5, 12, 13, 6, 4, 5, 2, 6, 1, 2, 1, 2, 0, 1, 3, 2,
              4, 2, 2, 1, 0, 0, 0, 1, 1, 2, 1, 2, 1, 1, 0, 1, 2, 2, 0, 1, 0,
              2, 0, 0, 3, 1, 1, 0, 1, 3, 3, 0, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1,
              0, 1, 1, 0, 0, 0, 1, 0, 2, 2, 0, 2, 0, 0, 1, 0, 1, 1, 3, 0, 1,
              1, 1, 0, 0, 2, 0, 0, 0, 0, 2, 0, 1, 1, 1, 2, 0, 0, 1, 2, 4, 3,
              2, 0, 0, 3, 0, 0, 1, 1, 2, 1, 1, 2
            ],
            "seqs": [
              4, 63, 67, 97, 110, 114, 133, 181, 188, 215, 234, 243, 244, 245,
              249, 266, 270, 276, 282, 286, 290, 291, 294, 302, 303, 308, 318,
              325, 330, 334, 335, 344, 345, 350, 353, 358, 359, 364, 380, 383,
              384, 392, 423, 429, 431, 437, 446, 456, 457, 464, 467, 470, 475,
              476, 497, 510, 513, 529, 530, 531, 535, 542, 544, 546, 547, 554,
              565, 571, 580, 585, 588, 592, 595, 601, 602, 612, 619, 622, 624,
              626, 633, 636, 642, 644, 650, 658, 663, 666, 667, 669, 680, 685,
              686, 687, 688, 689, 690, 693, 694, 705, 718, 719, 724, 725, 741,
              743, 744, 750, 757, 758, 759, 760, 762, 765, 766, 767, 769, 771,
              774, 779, 782, 804, 806, 807, 808, 809, 812, 817, 820, 826, 830,
              831, 832, 848, 849, 853, 855, 856, 858, 862, 863, 864, 880, 882,
              885, 886, 887, 889, 890, 891, 903, 907, 915, 918, 919, 923, 926,
              927, 937, 938, 944, 952, 954, 955, 957, 959, 964, 966, 967, 971,
              980, 982, 985, 986, 992, 996, 1007, 1013, 1023, 1026, 1029,
              1031, 1037, 1038, 1039, 1040, 1043, 1047, 1048, 1051, 1060,
              1065, 1075, 1079, 1080, 1081, 1083, 1085, 1091, 1092, 1102,
              1104, 1109, 1110, 1111, 1115, 1124, 1125, 1126, 1131, 1139,
              1140, 1141, 1144, 1150, 1157, 1160, 1163, 1165, 1169, 1171,
              1173, 1176, 1177, 1179, 1183, 1187, 1192, 1194, 1202, 1204,
              1205, 1208, 1211, 1215, 1221, 1222, 1223, 1227, 1228, 1231,
              1232, 1233, 1236, 1237, 1242, 1243, 1244, 1246, 1247, 1248,
              1255, 1257, 1259, 1262, 1263, 1265, 1268, 1271, 1275, 1278,
              1279, 1282, 1284, 1285, 1286, 1293, 1299, 1301, 1304, 1306,
              1307, 1308, 1309, 1310, 1313, 1315, 1316, 1317, 1324, 1326,
              1328, 1331, 1332, 1339, 1342, 1343, 1344, 1346, 1347, 1348,
              1350, 1352, 1357, 1360, 1361, 1363, 1365, 1366, 1367, 1369,
              1370, 1384, 1385, 1388, 1391, 1395, 1401, 1407, 1408, 1415,
              1422, 1427, 1429, 1430, 1433, 1435, 1438, 1439, 1441, 1444,
              1446, 1447, 1449, 1450, 1451, 1452, 1454, 1455, 1457, 1459,
              1467, 1468, 1469, 1470, 1471, 1472, 1473, 1477, 1490, 1491,
              1497, 1505, 1506, 1507, 1514, 1516, 1517, 1521, 1523, 1524,
              1525, 1526, 1529, 1537, 1543, 1545, 1546, 1551, 1553, 1558,
              1559, 1562, 1567, 1568, 1569, 1570, 1571, 1572, 1578, 1582,
              1584, 1585, 1586, 1589, 1590, 1592, 1594, 1596, 1600, 1601,
              1603, 1604, 1605, 1607, 1608, 1609, 1615, 1616, 1617, 1618,
              1623, 1624, 1626, 1627, 1629, 1633, 1634, 1640, 1641, 1646,
              1650, 1656, 1657, 1663, 1669, 1679, 1681, 1682, 1683, 1685,
              1686, 1687, 1688, 1689, 1690, 1694, 1695, 1696, 1697, 1699,
              1700, 1704, 1705, 1707, 1708, 1719, 1720, 1722, 1726, 1727,
              1730, 1732, 1735, 1736, 1742, 1744, 1747, 1749, 1753, 1756,
              1766, 1768, 1769, 1773, 1775, 1776, 1778, 1780, 1781, 1782,
              1783, 1785, 1786, 1787, 1788, 1789, 1790, 1793, 1795, 1796,
              1801, 1802, 1806, 1807, 1808, 1813, 1815, 1816, 1817, 1819,
              1822, 1823, 1825, 1826, 1832, 1839, 1847, 1850, 1851, 1852,
              1856, 1859, 1862, 1866, 1869, 1870, 1872, 1874, 1882, 1883,
              1886, 1902, 1906, 1909, 1910, 1913, 1921, 1925, 1927, 1930,
              1931, 1932, 1935, 1938, 1942, 1944, 1945, 1946, 1948, 1949,
              1953, 1954, 1955, 1957, 1958, 1959, 1964, 1965, 1966, 1967,
              1968, 1969, 1971, 1972, 1976, 1981, 1986, 1997, 1999, 2000,
              2001, 2002, 2003, 2007, 2008, 2011, 2013, 2014, 2021, 2029,
              2033, 2034, 2035, 2036, 2038, 2041, 2044, 2045, 2046, 2052,
              2058, 2060, 2062, 2064, 2066, 2071, 2072, 2074, 2079, 2085,
              2086, 2089, 2093, 2097, 2098, 2100, 2101, 2102, 2104, 2105,
              2106, 2107, 2108, 2109, 2114, 2115, 2116, 2117, 2118, 2119,
              2122, 2130, 2131, 2132, 2133, 2136, 2138, 2143, 2145, 2147,
              2152, 2153, 2155, 2160, 2161, 2166, 2167, 2168, 2169, 2171,
              2175, 2177, 2178, 2179, 2180, 2186, 2187, 2193, 2195, 2197,
              2203, 2211, 2212, 2213, 2214, 2217, 2219, 2223, 2226, 2227,
              2229, 2230, 2231, 2232, 2234, 2235, 2236, 2237, 2239, 2244,
              2245, 2246, 2247, 2248, 2253, 2255, 2256, 2257, 2259, 2261,
              2265, 2266, 2271, 2272, 2276, 2278, 2279, 2284, 2285, 2288,
              2293, 2294, 2297, 2298, 2300, 2304, 2305, 2306, 2310, 2312,
              2317, 2318, 2322, 2325, 2327, 2332, 2333, 2335, 2336, 2337,
              2340, 2343, 2354, 2357, 2359, 2365, 2366, 2367, 2369, 2372,
              2374, 2375, 2376, 2377, 2380, 2387, 2388, 2389, 2390, 2391,
              2392, 2393, 2394, 2399, 2400, 2401, 2402, 2403, 2405, 2406,
              2410, 2412, 2413, 2414, 2416, 2420, 2421, 2425, 2426, 2427,
              2428, 2429, 2430, 2431, 2432, 2433, 2435, 2437, 2438, 2443,
              2445, 2447, 2452, 2453, 2454, 2455, 2456, 2457, 2459, 2462,
              2467, 2469, 2471, 2476, 2477, 2481, 2485, 2486, 2487, 2495,
              2497, 2498, 2499, 2501, 2506, 2510, 2519, 2520, 2525, 2527,
              2528, 2529, 2532, 2534, 2536, 2542, 2543, 2544, 2545, 2547,
              2550, 2551, 2552, 2553, 2556, 2558, 2561, 2562, 2564, 2565,
              2566, 2567, 2574, 2583, 2584, 2585, 2586, 2587, 2589, 2590,
              2591, 2596, 2598, 2600, 2602, 2605, 2606, 2607, 2614, 2615,
              2616, 2619, 2620, 2624, 2630, 2631, 2636, 2638, 2642, 2644,
              2650, 2651, 2653, 2655, 2656, 2660, 2671, 2673, 2675, 2676,
              2677, 2683, 2685, 2687, 2689, 2691, 2692, 2693, 2703, 2704,
              2705, 2706, 2707, 2710, 2711, 2713, 2714, 2719, 2721, 2722,
              2723, 2725, 2726, 2731, 2738, 2741, 2742, 2743, 2744, 2747,
              2749, 2758, 2761, 2771, 2772, 2777, 2783, 2785, 2786, 2787,
              2789, 2807, 2808, 2810, 2811, 2813, 2817, 2819, 2822, 2823,
              2824, 2827, 2833, 2834, 2835, 2836, 2837, 2840, 2842, 2843,
              2845, 2846, 2847, 2850, 2851, 2852, 2853, 2855, 2861, 2862,
              2864, 2865, 2868, 2869, 2873, 2875, 2876, 2877, 2878, 2879,
              2880, 2881, 2884, 2885, 2886, 2889, 2895, 2896, 2901, 2903,
              2904, 2905, 2907, 2908, 2912, 2914, 2919, 2920, 2932, 2933,
              2935, 2938, 2941, 2942, 2946, 2947, 2948, 2950, 2951, 2952,
              2954, 2958, 2959, 2965, 2966, 2969, 2971, 2972, 2973, 2978,
              2979, 2984, 2989, 2990, 2992, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 70,
                "sites": 935.5,
                "log_adj_pvalue": -796.2
              }
            ]
          }, {
            "db": 0,
            "id": "CTGAAACCCGRAGTAA",
            "alt": "MEME-4",
            "consensus": "CTGAAACCCGRAGTAA",
            "len": 16,
            "motif_evalue": "2.4e-1350",
            "motif_nsites": 919,
            "n_tested": 142,
            "score_threshold": 5,
            "pwm": [
              [0.019615, 0.763815, 0.00764041, 0.20893], 
              [0.00873421, 2.42411e-05, 0.00328789, 0.987953], 
              [0.0870717, 0.00546465, 0.907434, 3.01599e-05], 
              [0.996658, 2.42411e-05, 0.00328789, 3.01599e-05], 
              [0.999921, 2.42411e-05, 2.42411e-05, 3.01599e-05], 
              [0.994481, 0.00111212, 0.00111212, 0.0032938], 
              [0.00111804, 0.8378, 2.42411e-05, 0.161058], 
              [0.00547057, 0.938986, 2.42411e-05, 0.0555191], 
              [0.0163504, 0.901993, 0.00328789, 0.0783676], 
              [0.23613, 0.00328789, 0.76055, 3.01599e-05], 
              [0.455911, 2.42411e-05, 0.544035, 3.01599e-05], 
              [0.826926, 0.00111212, 0.171932, 3.01599e-05], 
              [0.143649, 2.42411e-05, 0.856297, 3.01599e-05], 
              [3.01599e-05, 0.00546465, 2.42411e-05, 0.994481], 
              [0.992305, 2.42411e-05, 0.00764041, 3.01599e-05], 
              [0.994481, 2.42411e-05, 0.0022, 0.0032938]
            ],
            "total_sites": 1022,
            "sites": [
              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 2,
              0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 3, 0, 1, 1, 0, 1, 2, 2, 3, 2,
              2, 5, 2, 6, 6, 7, 2, 9, 4, 9, 5, 9, 11, 12, 16, 20, 23, 27, 28,
              31, 22, 19, 32, 28, 14, 11, 17, 14, 14, 10, 8, 11, 3, 4, 6, 4,
              6, 3, 3, 4, 3, 0, 3, 6, 6, 14, 12, 11, 8, 10, 16, 18, 18, 22,
              26, 34, 26, 25, 27, 24, 28, 28, 16, 14, 9, 10, 4, 11, 9, 7, 6,
              5, 6, 6, 7, 8, 4, 2, 3, 2, 1, 2, 3, 2, 3, 0, 3, 0, 0, 2, 0, 0,
              0, 1, 3, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0,
              0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0,
              0, 0, 0, 0
            ],
            "seqs": [
              13, 67, 90, 97, 114, 133, 163, 181, 188, 244, 245, 249, 266,
              276, 282, 286, 290, 291, 294, 302, 303, 323, 325, 330, 334, 335,
              344, 345, 350, 353, 358, 364, 380, 413, 423, 429, 431, 437, 440,
              441, 443, 446, 456, 457, 464, 475, 510, 513, 529, 530, 531, 535,
              542, 544, 546, 554, 559, 561, 565, 571, 580, 588, 595, 601, 602,
              612, 619, 622, 624, 626, 633, 642, 644, 650, 663, 666, 680, 685,
              686, 687, 688, 689, 690, 693, 694, 705, 718, 719, 724, 725, 741,
              744, 750, 758, 759, 760, 762, 765, 766, 767, 771, 779, 782, 799,
              800, 804, 806, 807, 808, 812, 817, 820, 826, 830, 831, 832, 839,
              848, 849, 853, 856, 858, 859, 863, 880, 882, 885, 886, 887, 889,
              890, 891, 903, 907, 918, 919, 923, 926, 927, 932, 937, 938, 944,
              952, 954, 955, 963, 964, 966, 967, 971, 980, 982, 985, 986, 992,
              996, 1007, 1012, 1023, 1026, 1029, 1030, 1031, 1034, 1037, 1038,
              1039, 1040, 1043, 1047, 1048, 1051, 1060, 1065, 1079, 1080,
              1081, 1083, 1085, 1092, 1102, 1104, 1109, 1110, 1111, 1113,
              1115, 1123, 1124, 1125, 1126, 1130, 1131, 1139, 1141, 1144,
              1148, 1150, 1157, 1160, 1163, 1165, 1169, 1171, 1177, 1179,
              1187, 1188, 1189, 1192, 1194, 1204, 1205, 1206, 1208, 1211,
              1215, 1221, 1223, 1224, 1227, 1228, 1231, 1232, 1233, 1235,
              1236, 1238, 1242, 1243, 1244, 1246, 1247, 1248, 1255, 1257,
              1259, 1262, 1263, 1265, 1268, 1271, 1275, 1277, 1278, 1279,
              1282, 1284, 1285, 1286, 1293, 1299, 1301, 1304, 1306, 1307,
              1308, 1309, 1310, 1313, 1315, 1316, 1326, 1328, 1331, 1332,
              1339, 1342, 1343, 1344, 1346, 1347, 1348, 1350, 1357, 1360,
              1361, 1363, 1365, 1366, 1367, 1369, 1370, 1384, 1385, 1386,
              1388, 1391, 1401, 1407, 1408, 1415, 1420, 1427, 1429, 1433,
              1435, 1437, 1438, 1439, 1441, 1444, 1445, 1446, 1449, 1450,
              1451, 1452, 1453, 1454, 1455, 1457, 1459, 1468, 1469, 1471,
              1473, 1477, 1490, 1491, 1497, 1505, 1506, 1507, 1514, 1516,
              1521, 1523, 1524, 1525, 1526, 1529, 1537, 1540, 1543, 1545,
              1546, 1553, 1558, 1559, 1562, 1564, 1566, 1567, 1568, 1569,
              1570, 1571, 1572, 1582, 1584, 1585, 1589, 1591, 1592, 1594,
              1596, 1600, 1601, 1603, 1604, 1605, 1607, 1608, 1609, 1615,
              1616, 1617, 1624, 1626, 1629, 1633, 1634, 1640, 1646, 1650,
              1653, 1655, 1656, 1657, 1663, 1668, 1669, 1672, 1673, 1679,
              1682, 1683, 1684, 1685, 1686, 1687, 1688, 1689, 1690, 1694,
              1696, 1697, 1700, 1704, 1705, 1707, 1708, 1719, 1722, 1726,
              1727, 1732, 1735, 1736, 1737, 1742, 1744, 1747, 1749, 1753,
              1756, 1761, 1766, 1768, 1769, 1773, 1775, 1776, 1778, 1780,
              1781, 1782, 1783, 1786, 1787, 1788, 1789, 1790, 1793, 1795,
              1796, 1798, 1801, 1802, 1806, 1807, 1808, 1813, 1814, 1815,
              1816, 1822, 1823, 1826, 1827, 1832, 1837, 1847, 1850, 1851,
              1852, 1859, 1862, 1866, 1869, 1870, 1872, 1874, 1879, 1882,
              1883, 1884, 1885, 1886, 1898, 1902, 1906, 1909, 1910, 1911,
              1913, 1921, 1924, 1925, 1927, 1929, 1930, 1931, 1932, 1935,
              1938, 1942, 1944, 1945, 1946, 1947, 1948, 1949, 1951, 1953,
              1954, 1955, 1956, 1957, 1958, 1959, 1964, 1965, 1966, 1967,
              1968, 1971, 1976, 1981, 1983, 1986, 1997, 1999, 2000, 2001,
              2002, 2003, 2007, 2008, 2011, 2013, 2014, 2021, 2029, 2033,
              2034, 2035, 2036, 2038, 2041, 2044, 2045, 2046, 2052, 2058,
              2060, 2062, 2064, 2066, 2068, 2071, 2072, 2073, 2074, 2079,
              2083, 2085, 2087, 2089, 2093, 2094, 2096, 2097, 2098, 2100,
              2101, 2102, 2103, 2104, 2105, 2106, 2107, 2109, 2114, 2115,
              2116, 2117, 2119, 2122, 2123, 2130, 2132, 2133, 2134, 2136,
              2138, 2145, 2147, 2152, 2155, 2158, 2160, 2161, 2166, 2167,
              2168, 2169, 2171, 2175, 2177, 2179, 2180, 2186, 2193, 2197,
              2199, 2203, 2206, 2211, 2212, 2213, 2214, 2217, 2218, 2219,
              2222, 2223, 2226, 2227, 2229, 2230, 2231, 2232, 2234, 2235,
              2236, 2237, 2239, 2242, 2244, 2245, 2246, 2247, 2248, 2251,
              2255, 2256, 2257, 2259, 2260, 2261, 2262, 2266, 2268, 2271,
              2272, 2276, 2278, 2279, 2284, 2293, 2294, 2297, 2298, 2300,
              2304, 2305, 2306, 2310, 2317, 2318, 2321, 2322, 2325, 2327,
              2332, 2333, 2335, 2336, 2337, 2343, 2345, 2346, 2354, 2357,
              2359, 2365, 2366, 2367, 2372, 2374, 2375, 2376, 2377, 2383,
              2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394,
              2395, 2399, 2400, 2402, 2403, 2405, 2406, 2410, 2412, 2413,
              2414, 2416, 2421, 2425, 2426, 2427, 2428, 2429, 2432, 2435,
              2437, 2438, 2443, 2445, 2447, 2452, 2453, 2454, 2455, 2456,
              2457, 2459, 2461, 2462, 2467, 2469, 2471, 2476, 2477, 2481,
              2485, 2486, 2487, 2495, 2497, 2498, 2499, 2501, 2506, 2510,
              2519, 2520, 2525, 2528, 2532, 2534, 2535, 2536, 2538, 2541,
              2542, 2543, 2544, 2545, 2546, 2547, 2550, 2551, 2552, 2553,
              2556, 2558, 2561, 2562, 2564, 2566, 2567, 2572, 2573, 2574,
              2578, 2582, 2583, 2584, 2585, 2587, 2588, 2589, 2590, 2591,
              2595, 2596, 2597, 2599, 2600, 2602, 2605, 2606, 2607, 2611,
              2614, 2615, 2616, 2619, 2620, 2621, 2624, 2626, 2630, 2631,
              2636, 2638, 2642, 2644, 2650, 2651, 2653, 2655, 2656, 2667,
              2668, 2671, 2673, 2675, 2676, 2677, 2680, 2681, 2682, 2683,
              2687, 2688, 2689, 2691, 2692, 2694, 2703, 2704, 2705, 2706,
              2707, 2708, 2711, 2712, 2713, 2719, 2721, 2724, 2725, 2726,
              2728, 2730, 2731, 2732, 2738, 2741, 2743, 2744, 2745, 2746,
              2747, 2749, 2758, 2761, 2770, 2775, 2777, 2782, 2783, 2785,
              2786, 2787, 2789, 2808, 2810, 2811, 2813, 2815, 2817, 2819,
              2822, 2823, 2824, 2827, 2832, 2833, 2834, 2835, 2836, 2837,
              2840, 2841, 2842, 2843, 2845, 2846, 2847, 2850, 2851, 2852,
              2853, 2855, 2857, 2859, 2861, 2862, 2863, 2864, 2865, 2866,
              2867, 2868, 2869, 2870, 2871, 2873, 2874, 2875, 2876, 2877,
              2878, 2879, 2880, 2881, 2884, 2885, 2886, 2888, 2889, 2890,
              2895, 2896, 2903, 2904, 2905, 2907, 2908, 2909, 2910, 2912,
              2914, 2919, 2920, 2932, 2933, 2935, 2938, 2942, 2946, 2947,
              2948, 2950, 2952, 2954, 2958, 2959, 2965, 2966, 2969, 2971,
              2973, 2977, 2978, 2979, 2984, 2985, 2986, 2988, 2989, 2990,
              2992, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 79,
                "sites": 959,
                "log_adj_pvalue": -1012.31
              }
            ]
          }, {
            "db": 0,
            "id": "TYGGCATAACCTCCCT",
            "alt": "MEME-5",
            "consensus": "TYGGCATAACCTCCCT",
            "len": 16,
            "motif_evalue": "2.0e-818",
            "motif_nsites": 678,
            "n_tested": 142,
            "score_threshold": 5,
            "pwm": [
              [0.00151566, 3.28565e-05, 3.28565e-05, 0.998419], 
              [0.00151566, 0.570745, 0.0044572, 0.423282], 
              [0.179955, 0.00150764, 0.809648, 0.00888957], 
              [0.277286, 3.28565e-05, 0.719691, 0.00299044], 
              [0.00888957, 0.706419, 0.160776, 0.123917], 
              [0.980722, 0.00888155, 0.00740677, 0.00299044], 
              [0.255165, 3.28565e-05, 0.00740677, 0.737395], 
              [0.991045, 3.28565e-05, 0.00888155, 4.08789e-05], 
              [0.993994, 3.28565e-05, 0.00298242, 0.00299044], 
              [0.00446523, 0.696095, 3.28565e-05, 0.299407], 
              [0.00594001, 0.945321, 3.28565e-05, 0.0487067], 
              [0.00446523, 0.0044572, 0.00150764, 0.989571], 
              [0.0782004, 0.784578, 3.28565e-05, 0.137189], 
              [0.00594001, 0.906979, 3.28565e-05, 0.087049], 
              [0.0192121, 0.884858, 0.0044572, 0.0914724], 
              [0.0103634, 0.0354256, 3.28565e-05, 0.954177]
            ],
            "total_sites": 1079,
            "sites": [
              0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 1,
              0, 1, 2, 0, 0, 2, 0, 3, 3, 1, 2, 3, 0, 2, 1, 0, 2, 0, 1, 2, 0,
              0, 1, 1, 1, 1, 4, 1, 1, 2, 0, 1, 1, 1, 3, 1, 1, 1, 0, 1, 3, 1,
              3, 3, 3, 3, 1, 2, 0, 4, 4, 7, 15, 5, 12, 12, 10, 20, 16, 19, 20,
              28, 33, 23, 34, 22, 26, 25, 23, 21, 13, 8, 7, 8, 10, 6, 7, 7, 8,
              4, 8, 3, 2, 1, 2, 5, 0, 0, 1, 1, 1, 1, 3, 2, 0, 1, 0, 0, 1, 0,
              0, 2, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 3, 3, 1, 4,
              4, 4, 1, 4, 5, 4, 4, 7, 6, 3, 10, 14, 14, 20, 19, 26, 27, 27,
              25, 20, 31, 29, 16, 12, 17, 9, 16, 13, 13, 9, 8, 4, 3, 2, 4, 2,
              1, 1, 1, 1, 0, 2, 3, 3, 4, 3, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1,
              1, 0, 1, 0, 2, 0, 0, 1, 1, 0, 1, 2, 1, 1, 0, 1, 4, 2, 0, 1, 3,
              1, 2, 1, 0, 0, 3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
              1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
              1, 0
            ],
            "seqs": [
              63, 67, 90, 97, 114, 133, 163, 181, 188, 204, 234, 244, 245,
              249, 266, 276, 282, 286, 290, 291, 294, 302, 303, 308, 323, 325,
              326, 330, 335, 344, 345, 350, 353, 358, 364, 380, 384, 392, 413,
              423, 429, 431, 437, 440, 441, 443, 446, 456, 457, 464, 467, 470,
              475, 476, 497, 510, 513, 529, 530, 531, 542, 544, 546, 554, 559,
              565, 571, 580, 585, 588, 595, 601, 602, 612, 619, 622, 624, 626,
              633, 636, 642, 644, 650, 658, 663, 666, 667, 680, 685, 686, 687,
              688, 689, 693, 694, 705, 718, 719, 724, 725, 741, 744, 750, 757,
              758, 759, 760, 762, 765, 766, 767, 770, 771, 779, 782, 804, 806,
              807, 808, 809, 812, 817, 820, 826, 830, 831, 832, 848, 849, 853,
              855, 856, 858, 862, 863, 880, 882, 885, 886, 887, 889, 890, 891,
              903, 907, 918, 919, 923, 926, 928, 932, 937, 938, 944, 952, 954,
              955, 964, 966, 967, 971, 975, 980, 982, 985, 986, 992, 996,
              1007, 1013, 1023, 1026, 1029, 1031, 1037, 1038, 1040, 1043,
              1047, 1048, 1051, 1059, 1060, 1065, 1075, 1079, 1080, 1081,
              1083, 1085, 1091, 1092, 1102, 1104, 1109, 1110, 1111, 1115,
              1123, 1124, 1125, 1126, 1131, 1139, 1140, 1141, 1144, 1148,
              1150, 1157, 1160, 1163, 1165, 1169, 1171, 1176, 1177, 1179,
              1183, 1187, 1188, 1189, 1192, 1194, 1202, 1204, 1205, 1208,
              1211, 1215, 1221, 1223, 1224, 1227, 1228, 1231, 1232, 1233,
              1236, 1237, 1238, 1242, 1243, 1244, 1246, 1247, 1248, 1255,
              1257, 1259, 1262, 1263, 1265, 1268, 1271, 1275, 1277, 1278,
              1279, 1282, 1284, 1285, 1286, 1293, 1299, 1301, 1304, 1306,
              1307, 1308, 1309, 1310, 1313, 1315, 1316, 1326, 1328, 1331,
              1332, 1339, 1342, 1343, 1344, 1346, 1347, 1348, 1350, 1352,
              1357, 1360, 1361, 1363, 1365, 1366, 1367, 1369, 1370, 1380,
              1384, 1385, 1386, 1387, 1388, 1391, 1395, 1401, 1407, 1408,
              1415, 1422, 1427, 1429, 1433, 1435, 1437, 1438, 1439, 1441,
              1444, 1445, 1446, 1447, 1449, 1450, 1451, 1452, 1454, 1455,
              1457, 1459, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1477,
              1490, 1491, 1497, 1505, 1506, 1507, 1514, 1516, 1521, 1523,
              1524, 1525, 1526, 1529, 1537, 1543, 1545, 1546, 1553, 1558,
              1559, 1562, 1564, 1566, 1567, 1568, 1569, 1570, 1571, 1572,
              1578, 1582, 1584, 1585, 1589, 1590, 1592, 1594, 1596, 1600,
              1601, 1603, 1604, 1605, 1607, 1608, 1609, 1615, 1616, 1617,
              1623, 1624, 1626, 1627, 1629, 1633, 1634, 1640, 1641, 1646,
              1650, 1656, 1657, 1663, 1669, 1679, 1682, 1683, 1685, 1686,
              1687, 1688, 1689, 1690, 1694, 1696, 1697, 1699, 1700, 1704,
              1705, 1707, 1708, 1719, 1720, 1722, 1726, 1727, 1730, 1732,
              1735, 1736, 1737, 1742, 1744, 1747, 1749, 1753, 1756, 1761,
              1766, 1768, 1769, 1770, 1773, 1775, 1776, 1778, 1780, 1781,
              1782, 1783, 1785, 1786, 1788, 1789, 1790, 1793, 1795, 1796,
              1801, 1802, 1806, 1807, 1808, 1813, 1815, 1816, 1817, 1823,
              1826, 1832, 1839, 1847, 1850, 1851, 1852, 1856, 1859, 1862,
              1866, 1869, 1870, 1872, 1874, 1882, 1883, 1886, 1898, 1902,
              1909, 1910, 1911, 1913, 1921, 1925, 1927, 1930, 1931, 1932,
              1935, 1938, 1942, 1944, 1945, 1946, 1948, 1949, 1953, 1954,
              1955, 1957, 1958, 1959, 1964, 1965, 1966, 1967, 1968, 1969,
              1971, 1972, 1974, 1976, 1981, 1986, 1997, 1999, 2000, 2001,
              2002, 2003, 2007, 2008, 2011, 2013, 2014, 2021, 2022, 2029,
              2033, 2034, 2035, 2036, 2038, 2041, 2044, 2045, 2046, 2052,
              2058, 2060, 2062, 2064, 2066, 2068, 2071, 2072, 2074, 2079,
              2085, 2086, 2089, 2093, 2097, 2098, 2100, 2101, 2102, 2104,
              2105, 2106, 2107, 2108, 2109, 2114, 2115, 2116, 2119, 2122,
              2130, 2131, 2132, 2133, 2136, 2138, 2145, 2147, 2152, 2153,
              2155, 2158, 2160, 2161, 2166, 2167, 2168, 2169, 2171, 2175,
              2177, 2179, 2180, 2186, 2187, 2193, 2203, 2211, 2212, 2213,
              2214, 2217, 2219, 2223, 2226, 2227, 2229, 2231, 2232, 2234,
              2235, 2236, 2237, 2239, 2244, 2245, 2246, 2247, 2248, 2253,
              2255, 2256, 2257, 2259, 2261, 2265, 2266, 2271, 2272, 2276,
              2278, 2279, 2284, 2285, 2288, 2293, 2294, 2297, 2298, 2300,
              2304, 2305, 2306, 2310, 2317, 2318, 2321, 2322, 2325, 2327,
              2332, 2333, 2335, 2336, 2337, 2340, 2343, 2354, 2357, 2359,
              2365, 2366, 2367, 2369, 2372, 2374, 2375, 2376, 2377, 2380,
              2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 2399, 2400,
              2401, 2402, 2403, 2404, 2405, 2406, 2410, 2412, 2413, 2414,
              2416, 2420, 2421, 2425, 2426, 2427, 2428, 2429, 2430, 2431,
              2432, 2433, 2435, 2437, 2438, 2443, 2445, 2447, 2452, 2453,
              2454, 2455, 2456, 2457, 2459, 2462, 2467, 2469, 2471, 2476,
              2477, 2481, 2485, 2486, 2487, 2495, 2497, 2498, 2499, 2501,
              2506, 2510, 2519, 2520, 2525, 2527, 2528, 2532, 2534, 2536,
              2542, 2543, 2544, 2545, 2547, 2550, 2551, 2552, 2553, 2555,
              2556, 2558, 2561, 2562, 2564, 2566, 2567, 2574, 2583, 2584,
              2585, 2586, 2587, 2589, 2590, 2591, 2596, 2598, 2600, 2602,
              2605, 2606, 2607, 2614, 2615, 2616, 2619, 2620, 2624, 2630,
              2631, 2636, 2642, 2644, 2650, 2651, 2653, 2655, 2656, 2660,
              2671, 2673, 2675, 2676, 2677, 2683, 2685, 2687, 2689, 2691,
              2692, 2693, 2703, 2704, 2705, 2706, 2707, 2708, 2710, 2711,
              2713, 2714, 2719, 2721, 2722, 2723, 2725, 2726, 2728, 2738,
              2741, 2742, 2743, 2744, 2747, 2749, 2758, 2761, 2771, 2772,
              2777, 2783, 2785, 2786, 2787, 2789, 2794, 2807, 2810, 2811,
              2813, 2817, 2819, 2823, 2824, 2827, 2833, 2834, 2835, 2836,
              2837, 2840, 2842, 2843, 2845, 2847, 2850, 2851, 2852, 2853,
              2855, 2861, 2862, 2864, 2865, 2868, 2869, 2871, 2873, 2875,
              2876, 2877, 2878, 2879, 2880, 2881, 2884, 2885, 2886, 2889,
              2895, 2896, 2901, 2903, 2904, 2905, 2907, 2908, 2912, 2914,
              2919, 2920, 2932, 2933, 2935, 2938, 2942, 2946, 2947, 2948,
              2950, 2951, 2952, 2954, 2958, 2959, 2965, 2966, 2969, 2971,
              2972, 2973, 2978, 2979, 2984, 2989, 2990, 2992, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 103,
                "sites": 927,
                "log_adj_pvalue": -571.277
              }
            ]
          }, {
            "db": 1,
            "id": "GGGHCCM",
            "alt": "DREME-1",
            "consensus": "GGGHCCM",
            "len": 7,
            "motif_evalue": "2.7e-1053",
            "motif_nsites": 2945,
            "n_tested": 146,
            "score_threshold": 5,
            "pwm": [
              [9.41224e-06, 7.56511e-06, 0.999974, 9.41224e-06], 
              [9.41224e-06, 7.56511e-06, 0.999974, 9.41224e-06], 
              [9.41224e-06, 7.56511e-06, 0.999974, 9.41224e-06], 
              [0.378265, 0.3657, 7.56511e-06, 0.256028], 
              [9.41224e-06, 0.999974, 7.56511e-06, 9.41224e-06], 
              [9.41224e-06, 0.999974, 7.56511e-06, 9.41224e-06], 
              [0.555169, 0.444814, 7.56511e-06, 9.41224e-06]
            ],
            "total_sites": 2915,
            "sites": [
              2, 0, 0, 0.25, 0.25, 0, 1.25, 0.25, 0, 1.5, 0.833333, 0.333333,
              0.5, 0.75, 1.25, 0, 0.25, 0.75, 0, 0.5, 0.5, 0.5, 1.25, 0.5,
              0.333333, 0, 0.5, 0.333333, 0.5, 0.5, 1, 0.5, 2, 1.75, 0.25,
              0.333333, 0, 0, 0.75, 1.75, 0.5, 0, 0, 0, 0, 0, 0, 1, 1.5,
              0.333333, 0.333333, 0, 0.25, 2.41667, 0.25, 0.333333, 0.5, 0.5,
              2, 1.33333, 1.33333, 0.5, 0.5, 0.25, 0.25, 0, 0, 0.5, 0.5, 0.5,
              0.5, 0.5, 0, 0.5, 0.366667, 1.5, 0.5, 1, 0, 0, 2.5, 1.75, 1.5,
              2, 2.75, 1.25, 2, 0, 1.5, 3, 2, 2.83333, 3, 2, 4.58333, 2.25,
              1.5, 2.5, 1.75, 0.25, 3.5, 0, 2.33333, 1.83333, 1.5, 0.5, 3.5,
              2.75, 2.25, 2, 2, 2, 1.5, 4.5, 1, 1, 1.25, 1.33333, 8.58333,
              2.75, 2.91667, 5.16667, 3, 4.83333, 4.83333, 5.5, 11.25, 10.25,
              9.25, 8, 12, 3.83333, 15.0333, 12.75, 14.0833, 22.5, 40.1667,
              27.4167, 33.5833, 30.4167, 63.0833, 72.0833, 95.75, 117.167,
              125, 136.867, 177.417, 196.5, 237.583, 175.417, 160.333,
              138.083, 111.417, 90.5, 67.8333, 62.8333, 45.5833, 41.8333,
              30.1667, 28.8333, 30.25, 24.25, 15.5833, 14, 16.8333, 17.2, 8.5,
              11.0833, 7.83333, 8.91667, 2, 3.75, 7.25, 5.75, 10, 6.78333,
              7.2, 4, 2.25, 2.25, 1.75, 2.5, 3.25, 2.83333, 2.5, 2.41667, 2,
              3.25, 0.25, 1.2, 0.783333, 3.58333, 1.5, 0.75, 1, 4.25, 2.75,
              0.5, 1.83333, 2.33333, 1.83333, 0.333333, 1.5, 5.75, 3.75, 0,
              1.91667, 4.08333, 2.5, 3, 1.25, 1.75, 1, 1, 1, 0, 2, 0.25, 2,
              2.91667, 1, 0, 0.5, 1.83333, 0, 0.5, 1, 1.5, 1.5, 1, 0.833333,
              0.2, 1.2, 2, 0, 2.5, 1, 0.25, 1.25, 0, 0, 0, 0, 1, 0.333333,
              0.833333, 0, 0.5, 1.08333, 0.5, 1, 1.5, 0.5, 0.333333, 0.5, 0.5,
              0.5, 1, 0.5, 0, 0.75, 0.333333, 0, 0, 0, 0, 0, 0, 0, 1, 2.25,
              1.5, 0.5, 0.25, 0, 1.16667, 0.666667, 0, 1, 0.833333, 1.16667,
              0.75, 0.5, 1, 0, 0, 0, 1.66667, 2, 0.5, 0, 0.333333, 0, 1
            ],
            "seqs": [
              0, 3, 4, 5, 6, 7, 9, 10, 12, 14, 15, 16, 19, 20, 21, 22, 23, 24,
              25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42,
              43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59,
              60, 61, 62, 65, 66, 67, 68, 69, 70, 72, 73, 74, 76, 77, 78, 79,
              81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
              97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
              110, 111, 112, 113, 114, 115, 116, 117, 119, 121, 122, 123, 125,
              126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
              139, 140, 141, 142, 143, 144, 146, 147, 148, 149, 150, 151, 152,
              153, 154, 155, 156, 157, 158, 159, 160, 162, 163, 164, 165, 166,
              167, 168, 169, 170, 171, 173, 174, 175, 176, 177, 178, 179, 180,
              181, 182, 183, 185, 186, 188, 189, 190, 192, 193, 195, 196, 197,
              198, 199, 200, 201, 202, 203, 205, 206, 208, 209, 210, 211, 212,
              213, 214, 215, 216, 217, 218, 219, 220, 221, 223, 224, 225, 226,
              227, 228, 230, 231, 232, 233, 234, 235, 237, 238, 240, 241, 242,
              243, 244, 245, 246, 249, 250, 251, 252, 253, 254, 255, 257, 258,
              259, 260, 261, 262, 263, 264, 265, 266, 267, 269, 270, 271, 272,
              273, 274, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286,
              288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 299, 300, 301,
              303, 305, 306, 307, 308, 309, 310, 311, 312, 313, 315, 316, 317,
              318, 320, 322, 323, 324, 325, 327, 328, 329, 330, 331, 332, 333,
              334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346,
              347, 348, 349, 350, 351, 352, 353, 354, 356, 357, 358, 360, 363,
              364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376,
              377, 379, 380, 381, 382, 383, 385, 386, 387, 389, 390, 391, 394,
              395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 407, 408, 410,
              412, 413, 414, 415, 417, 418, 420, 421, 422, 423, 424, 425, 427,
              428, 429, 430, 431, 433, 434, 435, 436, 437, 438, 439, 440, 441,
              442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454,
              455, 456, 457, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468,
              470, 471, 472, 473, 474, 475, 476, 480, 481, 482, 483, 486, 487,
              488, 489, 490, 491, 492, 493, 494, 495, 496, 498, 499, 500, 501,
              502, 503, 504, 505, 506, 507, 509, 510, 511, 513, 515, 516, 517,
              518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 529, 530, 531,
              532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544,
              546, 547, 548, 549, 550, 551, 553, 554, 555, 556, 557, 558, 559,
              560, 562, 563, 564, 565, 568, 569, 570, 571, 572, 573, 574, 577,
              578, 579, 580, 581, 582, 583, 586, 587, 588, 589, 590, 591, 592,
              593, 597, 598, 599, 602, 603, 604, 605, 606, 607, 608, 609, 610,
              611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623,
              624, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637,
              638, 639, 640, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651,
              652, 653, 654, 656, 657, 658, 659, 661, 662, 663, 664, 665, 666,
              667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 680,
              682, 683, 684, 685, 686, 687, 688, 689, 690, 692, 693, 694, 695,
              696, 697, 698, 699, 700, 701, 703, 704, 705, 707, 708, 709, 710,
              711, 712, 713, 714, 715, 716, 717, 718, 719, 721, 722, 723, 724,
              725, 726, 727, 728, 729, 730, 731, 732, 734, 735, 736, 738, 739,
              740, 741, 742, 743, 744, 746, 747, 748, 749, 750, 751, 752, 753,
              754, 755, 756, 757, 759, 760, 761, 762, 764, 765, 766, 767, 768,
              769, 770, 771, 772, 774, 775, 777, 778, 779, 780, 781, 782, 783,
              785, 786, 787, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798,
              802, 803, 804, 805, 806, 808, 809, 810, 811, 812, 813, 814, 816,
              817, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830,
              831, 833, 834, 835, 837, 838, 840, 841, 842, 843, 844, 845, 846,
              847, 848, 849, 850, 851, 852, 854, 856, 857, 860, 863, 864, 866,
              870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 883,
              884, 885, 886, 887, 889, 890, 891, 892, 893, 894, 895, 897, 898,
              899, 900, 901, 902, 903, 904, 905, 908, 909, 910, 911, 912, 913,
              914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926,
              927, 928, 929, 930, 931, 932, 933, 935, 936, 937, 938, 939, 940,
              941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953,
              954, 955, 957, 958, 959, 960, 962, 965, 966, 967, 969, 971, 972,
              973, 974, 976, 977, 978, 979, 980, 981, 982, 984, 985, 986, 987,
              988, 989, 991, 994, 995, 996, 997, 998, 999, 1000, 1002, 1003,
              1004, 1006, 1007, 1008, 1010, 1013, 1014, 1015, 1017, 1018,
              1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028,
              1029, 1031, 1032, 1033, 1035, 1036, 1037, 1038, 1039, 1041,
              1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051,
              1052, 1053, 1054, 1056, 1059, 1060, 1062, 1064, 1065, 1066,
              1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1079,
              1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090,
              1091, 1092, 1093, 1095, 1096, 1098, 1099, 1100, 1101, 1104,
              1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1115, 1116,
              1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126,
              1127, 1128, 1129, 1131, 1133, 1134, 1135, 1136, 1138, 1139,
              1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149,
              1150, 1151, 1152, 1153, 1154, 1156, 1157, 1158, 1161, 1162,
              1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172,
              1173, 1174, 1175, 1176, 1178, 1180, 1181, 1182, 1183, 1184,
              1185, 1186, 1187, 1188, 1189, 1192, 1193, 1194, 1195, 1196,
              1197, 1198, 1200, 1202, 1203, 1204, 1205, 1207, 1209, 1210,
              1211, 1212, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221,
              1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231,
              1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1241, 1242,
              1243, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1254, 1255,
              1256, 1257, 1259, 1262, 1263, 1264, 1265, 1267, 1268, 1269,
              1270, 1271, 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280,
              1281, 1282, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291,
              1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1304, 1305,
              1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 1315,
              1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 1325,
              1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335,
              1336, 1337, 1338, 1339, 1341, 1343, 1344, 1345, 1346, 1347,
              1348, 1350, 1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358,
              1359, 1360, 1362, 1363, 1364, 1365, 1366, 1367, 1368, 1369,
              1370, 1371, 1372, 1374, 1375, 1376, 1377, 1378, 1380, 1381,
              1382, 1384, 1386, 1388, 1389, 1390, 1391, 1392, 1393, 1394,
              1396, 1397, 1398, 1399, 1400, 1401, 1402, 1405, 1406, 1407,
              1408, 1409, 1410, 1411, 1413, 1414, 1415, 1416, 1417, 1418,
              1423, 1424, 1425, 1427, 1428, 1430, 1431, 1432, 1433, 1434,
              1435, 1437, 1438, 1439, 1440, 1441, 1442, 1444, 1445, 1448,
              1449, 1450, 1451, 1452, 1454, 1455, 1456, 1457, 1459, 1461,
              1462, 1463, 1464, 1466, 1467, 1468, 1471, 1472, 1473, 1474,
              1476, 1477, 1478, 1480, 1481, 1482, 1483, 1484, 1485, 1486,
              1488, 1489, 1490, 1491, 1492, 1494, 1495, 1496, 1497, 1498,
              1499, 1500, 1501, 1502, 1503, 1505, 1506, 1507, 1508, 1509,
              1510, 1513, 1514, 1515, 1517, 1519, 1521, 1522, 1523, 1524,
              1525, 1526, 1527, 1528, 1529, 1530, 1532, 1533, 1534, 1535,
              1537, 1538, 1539, 1541, 1542, 1543, 1545, 1546, 1548, 1549,
              1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560,
              1561, 1562, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571,
              1573, 1574, 1575, 1577, 1578, 1579, 1581, 1582, 1583, 1584,
              1585, 1586, 1587, 1588, 1589, 1590, 1592, 1593, 1594, 1595,
              1596, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1607,
              1608, 1609, 1610, 1611, 1612, 1613, 1615, 1616, 1617, 1618,
              1619, 1620, 1622, 1623, 1624, 1625, 1626, 1627, 1628, 1629,
              1630, 1631, 1632, 1633, 1634, 1636, 1637, 1638, 1639, 1640,
              1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650,
              1651, 1652, 1654, 1656, 1657, 1658, 1659, 1661, 1662, 1663,
              1664, 1665, 1667, 1669, 1670, 1674, 1676, 1677, 1678, 1679,
              1680, 1682, 1683, 1685, 1686, 1687, 1688, 1690, 1691, 1692,
              1694, 1696, 1697, 1698, 1699, 1700, 1701, 1703, 1704, 1705,
              1706, 1708, 1709, 1710, 1712, 1713, 1714, 1715, 1716, 1717,
              1718, 1719, 1720, 1722, 1723, 1724, 1725, 1726, 1727, 1728,
              1729, 1730, 1731, 1732, 1734, 1735, 1736, 1737, 1738, 1739,
              1742, 1743, 1744, 1746, 1747, 1750, 1752, 1753, 1754, 1755,
              1756, 1757, 1759, 1760, 1761, 1762, 1763, 1764, 1765, 1766,
              1767, 1768, 1769, 1770, 1772, 1773, 1775, 1776, 1777, 1778,
              1780, 1781, 1782, 1783, 1784, 1786, 1787, 1788, 1790, 1791,
              1792, 1793, 1794, 1795, 1796, 1799, 1800, 1801, 1802, 1803,
              1804, 1805, 1806, 1807, 1808, 1810, 1813, 1815, 1816, 1817,
              1818, 1819, 1820, 1821, 1822, 1823, 1826, 1829, 1830, 1831,
              1832, 1833, 1834, 1835, 1838, 1840, 1841, 1842, 1843, 1844,
              1845, 1848, 1849, 1851, 1852, 1854, 1855, 1857, 1858, 1859,
              1860, 1861, 1862, 1863, 1864, 1866, 1867, 1869, 1870, 1871,
              1872, 1874, 1875, 1876, 1878, 1880, 1882, 1883, 1886, 1889,
              1893, 1894, 1895, 1896, 1897, 1898, 1899, 1901, 1904, 1907,
              1908, 1909, 1910, 1911, 1912, 1914, 1915, 1916, 1917, 1918,
              1919, 1922, 1925, 1926, 1927, 1928, 1930, 1931, 1934, 1935,
              1936, 1938, 1939, 1941, 1942, 1943, 1944, 1945, 1946, 1948,
              1950, 1952, 1953, 1954, 1959, 1961, 1962, 1963, 1964, 1965,
              1966, 1967, 1968, 1970, 1971, 1972, 1974, 1975, 1976, 1977,
              1980, 1981, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992,
              1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
              2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012, 2013, 2014,
              2015, 2016, 2017, 2019, 2020, 2021, 2023, 2024, 2025, 2026,
              2027, 2029, 2031, 2032, 2033, 2034, 2036, 2038, 2039, 2040,
              2041, 2042, 2044, 2045, 2047, 2048, 2049, 2050, 2052, 2053,
              2054, 2055, 2057, 2058, 2059, 2062, 2063, 2064, 2066, 2067,
              2068, 2069, 2070, 2071, 2072, 2079, 2081, 2086, 2088, 2089,
              2090, 2091, 2093, 2097, 2098, 2100, 2101, 2104, 2105, 2106,
              2107, 2109, 2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120,
              2121, 2122, 2124, 2126, 2127, 2128, 2129, 2131, 2132, 2133,
              2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2144, 2145,
              2146, 2148, 2152, 2154, 2155, 2156, 2157, 2160, 2161, 2162,
              2163, 2164, 2167, 2168, 2169, 2171, 2173, 2175, 2177, 2179,
              2180, 2184, 2185, 2186, 2187, 2190, 2192, 2193, 2194, 2197,
              2198, 2200, 2201, 2202, 2203, 2205, 2208, 2209, 2210, 2211,
              2212, 2213, 2214, 2215, 2216, 2219, 2220, 2221, 2223, 2226,
              2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 2235, 2236,
              2237, 2239, 2240, 2241, 2244, 2245, 2246, 2247, 2248, 2250,
              2252, 2254, 2255, 2256, 2257, 2258, 2259, 2261, 2263, 2264,
              2267, 2271, 2272, 2273, 2275, 2276, 2278, 2279, 2280, 2281,
              2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2293,
              2294, 2295, 2297, 2298, 2299, 2300, 2301, 2303, 2304, 2305,
              2308, 2310, 2311, 2312, 2313, 2314, 2315, 2316, 2317, 2318,
              2319, 2321, 2322, 2323, 2324, 2325, 2327, 2328, 2329, 2330,
              2331, 2332, 2333, 2335, 2336, 2337, 2338, 2342, 2343, 2344,
              2347, 2349, 2350, 2351, 2352, 2354, 2355, 2356, 2357, 2358,
              2359, 2360, 2361, 2362, 2363, 2365, 2366, 2367, 2368, 2369,
              2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379,
              2380, 2381, 2382, 2384, 2385, 2387, 2388, 2389, 2390, 2391,
              2392, 2393, 2394, 2396, 2398, 2399, 2400, 2401, 2402, 2403,
              2404, 2407, 2409, 2410, 2411, 2412, 2413, 2414, 2416, 2418,
              2420, 2421, 2422, 2423, 2426, 2427, 2428, 2429, 2430, 2432,
              2434, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2445, 2446,
              2447, 2448, 2453, 2454, 2456, 2457, 2458, 2459, 2462, 2463,
              2464, 2465, 2467, 2469, 2470, 2471, 2472, 2473, 2476, 2477,
              2479, 2481, 2482, 2484, 2487, 2488, 2489, 2490, 2491, 2492,
              2493, 2494, 2495, 2496, 2497, 2499, 2501, 2502, 2504, 2505,
              2506, 2507, 2508, 2510, 2511, 2513, 2517, 2519, 2521, 2522,
              2524, 2525, 2526, 2527, 2528, 2529, 2534, 2536, 2537, 2540,
              2542, 2543, 2544, 2545, 2547, 2549, 2550, 2553, 2554, 2556,
              2558, 2559, 2560, 2562, 2563, 2564, 2565, 2566, 2567, 2568,
              2569, 2570, 2571, 2574, 2575, 2576, 2577, 2579, 2580, 2584,
              2585, 2587, 2589, 2590, 2591, 2593, 2594, 2600, 2601, 2602,
              2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613,
              2614, 2615, 2616, 2618, 2619, 2620, 2624, 2627, 2628, 2629,
              2630, 2631, 2632, 2633, 2634, 2636, 2638, 2639, 2641, 2642,
              2644, 2645, 2646, 2647, 2648, 2651, 2653, 2654, 2655, 2656,
              2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 2665, 2670,
              2671, 2672, 2673, 2675, 2676, 2677, 2679, 2683, 2684, 2689,
              2691, 2692, 2693, 2695, 2696, 2697, 2698, 2703, 2704, 2705,
              2706, 2707, 2708, 2709, 2710, 2711, 2713, 2715, 2716, 2717,
              2718, 2720, 2721, 2723, 2728, 2729, 2731, 2733, 2735, 2736,
              2738, 2739, 2740, 2741, 2742, 2743, 2744, 2747, 2748, 2749,
              2750, 2751, 2753, 2754, 2758, 2760, 2762, 2763, 2764, 2765,
              2766, 2767, 2768, 2772, 2773, 2774, 2778, 2780, 2781, 2783,
              2784, 2785, 2786, 2787, 2788, 2790, 2793, 2795, 2796, 2797,
              2800, 2801, 2802, 2803, 2805, 2806, 2807, 2809, 2810, 2811,
              2812, 2813, 2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823,
              2824, 2826, 2827, 2833, 2834, 2836, 2837, 2839, 2842, 2843,
              2846, 2847, 2848, 2849, 2850, 2852, 2853, 2854, 2855, 2858,
              2861, 2862, 2864, 2865, 2868, 2869, 2873, 2875, 2876, 2877,
              2878, 2879, 2880, 2881, 2883, 2884, 2885, 2886, 2889, 2892,
              2893, 2894, 2896, 2897, 2898, 2899, 2901, 2902, 2903, 2904,
              2905, 2906, 2907, 2908, 2911, 2912, 2913, 2914, 2916, 2917,
              2919, 2920, 2921, 2922, 2924, 2925, 2926, 2927, 2928, 2929,
              2930, 2931, 2934, 2935, 2938, 2942, 2943, 2944, 2945, 2946,
              2947, 2949, 2950, 2952, 2953, 2954, 2955, 2957, 2958, 2959,
              2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968, 2969, 2972,
              2973, 2975, 2976, 2978, 2979, 2982, 2983, 2984, 2987, 2989,
              2990, 2991, 2992, 2993, 2995, 2996, 2997, 2998, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 24,
                "sites": 2299.53,
                "log_adj_pvalue": -4310.39
              }
            ]
          }, {
            "db": 1,
            "id": "AAATYCGG",
            "alt": "DREME-2",
            "consensus": "AAATTCGG",
            "len": 8,
            "motif_evalue": "4.1e-248",
            "motif_nsites": 1129,
            "n_tested": 146,
            "score_threshold": 5,
            "pwm": [
              [0.999936, 1.97325e-05, 1.97325e-05, 2.45505e-05], 
              [0.999936, 1.97325e-05, 1.97325e-05, 2.45505e-05], 
              [0.999936, 1.97325e-05, 1.97325e-05, 2.45505e-05], 
              [2.45505e-05, 1.97325e-05, 1.97325e-05, 0.999936], 
              [2.45505e-05, 0.169181, 1.97325e-05, 0.830775], 
              [2.45505e-05, 0.999931, 1.97325e-05, 2.45505e-05], 
              [2.45505e-05, 1.97325e-05, 0.999931, 2.45505e-05], 
              [2.45505e-05, 1.97325e-05, 0.999931, 2.45505e-05]
            ],
            "total_sites": 953,
            "sites": [
              1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 1, 0, 0,
              0, 0, 0, 0, 0, 1.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0.333333, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0.333333,
              0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0,
              0, 0, 0.5, 0, 0, 0.5, 1, 0, 1, 0, 0, 0, 1.5, 2, 0, 1, 1, 0, 2,
              2.5, 2, 1, 4.5, 1.5, 6.5, 2.83333, 5.5, 8, 8, 13.5, 15, 11,
              17.5, 17.5, 20.5, 15, 10, 22.5, 20.5, 12.5, 13.5, 18, 18.5, 17,
              20, 17.5, 20, 9, 5.5, 9.5, 5.5, 6, 7.5, 4, 5, 3.5, 1.5, 2.33333,
              1, 1.5, 4.5, 2, 2, 1, 2.5, 1, 0.5, 3, 0.5, 4, 2.5, 2.5, 1, 2, 0,
              5, 0, 4.5, 0, 3, 1, 3, 1, 3, 6, 6.5, 10, 6, 4, 8.33333, 9, 9.5,
              13, 11.5, 15.5, 14, 16, 18, 18.5, 20, 18.5, 27.5, 29.5, 21, 18,
              25.5, 19.5, 16.5, 15.5, 10, 9, 8, 8.5, 3, 7, 8, 3, 4, 1, 4, 3,
              2.5, 2.5, 2.5, 2.5, 1, 1, 0, 0, 1, 0, 1, 0, 2, 0, 0.5, 1, 0.5,
              0, 0, 1, 0.5, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0.5, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0.333333, 0, 1, 1, 1, 0, 1.5,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0, 0
            ],
            "seqs": [
              13, 21, 48, 63, 67, 72, 74, 86, 90, 102, 113, 114, 117, 127,
              129, 133, 136, 137, 151, 160, 163, 181, 186, 188, 192, 213, 241,
              244, 245, 249, 266, 276, 277, 286, 290, 291, 294, 301, 302, 303,
              319, 323, 325, 330, 334, 335, 336, 344, 345, 350, 351, 358, 361,
              364, 377, 380, 384, 399, 407, 411, 413, 423, 429, 431, 437, 440,
              441, 446, 456, 457, 464, 470, 473, 475, 480, 499, 510, 511, 529,
              531, 534, 535, 541, 542, 544, 546, 554, 555, 562, 565, 571, 580,
              588, 601, 610, 612, 619, 622, 624, 626, 628, 633, 635, 636, 638,
              640, 642, 644, 649, 658, 663, 666, 676, 680, 685, 686, 687, 688,
              689, 690, 693, 694, 705, 718, 719, 724, 725, 741, 742, 744, 750,
              752, 756, 757, 759, 762, 765, 766, 767, 769, 771, 779, 782, 799,
              800, 804, 805, 806, 807, 808, 812, 816, 817, 820, 826, 831, 832,
              839, 848, 849, 853, 858, 859, 862, 863, 866, 880, 882, 885, 886,
              887, 889, 890, 891, 892, 900, 903, 907, 917, 918, 919, 923, 926,
              927, 932, 937, 938, 944, 952, 954, 955, 959, 963, 964, 965, 966,
              967, 971, 975, 980, 985, 996, 1007, 1023, 1026, 1029, 1030,
              1031, 1037, 1038, 1039, 1040, 1043, 1047, 1048, 1060, 1070,
              1079, 1085, 1087, 1089, 1091, 1092, 1101, 1109, 1110, 1111,
              1113, 1123, 1124, 1125, 1126, 1130, 1131, 1139, 1140, 1141,
              1144, 1148, 1150, 1157, 1163, 1165, 1169, 1170, 1171, 1176,
              1177, 1179, 1187, 1192, 1194, 1204, 1205, 1208, 1211, 1215,
              1221, 1223, 1224, 1227, 1228, 1231, 1232, 1233, 1236, 1238,
              1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1256, 1257,
              1259, 1263, 1271, 1275, 1278, 1279, 1282, 1285, 1286, 1293,
              1299, 1301, 1306, 1307, 1308, 1309, 1310, 1313, 1315, 1316,
              1328, 1337, 1339, 1342, 1344, 1346, 1348, 1350, 1357, 1359,
              1360, 1361, 1365, 1366, 1367, 1369, 1370, 1374, 1384, 1385,
              1387, 1388, 1391, 1395, 1401, 1407, 1429, 1435, 1437, 1438,
              1439, 1441, 1444, 1445, 1446, 1447, 1449, 1450, 1451, 1452,
              1453, 1455, 1457, 1459, 1471, 1473, 1490, 1491, 1497, 1506,
              1514, 1516, 1521, 1525, 1529, 1537, 1540, 1543, 1545, 1546,
              1547, 1553, 1555, 1558, 1562, 1564, 1566, 1567, 1569, 1570,
              1572, 1577, 1580, 1582, 1584, 1585, 1589, 1591, 1592, 1594,
              1600, 1601, 1603, 1604, 1605, 1607, 1616, 1617, 1621, 1624,
              1626, 1627, 1629, 1630, 1633, 1640, 1646, 1649, 1653, 1655,
              1656, 1657, 1660, 1661, 1663, 1668, 1669, 1672, 1673, 1679,
              1682, 1684, 1685, 1686, 1688, 1689, 1690, 1694, 1696, 1697,
              1699, 1701, 1704, 1705, 1708, 1719, 1720, 1727, 1730, 1735,
              1736, 1737, 1742, 1745, 1747, 1752, 1753, 1756, 1761, 1766,
              1768, 1769, 1773, 1775, 1776, 1778, 1779, 1780, 1781, 1782,
              1786, 1788, 1793, 1795, 1796, 1798, 1801, 1802, 1806, 1807,
              1808, 1813, 1814, 1815, 1816, 1822, 1825, 1826, 1827, 1832,
              1837, 1846, 1847, 1849, 1851, 1852, 1862, 1869, 1870, 1872,
              1879, 1882, 1884, 1885, 1886, 1898, 1902, 1906, 1909, 1910,
              1913, 1921, 1924, 1925, 1929, 1930, 1931, 1935, 1938, 1945,
              1946, 1947, 1949, 1951, 1953, 1954, 1955, 1956, 1958, 1959,
              1964, 1965, 1967, 1968, 1969, 1971, 1976, 1981, 1986, 1996,
              1997, 2000, 2001, 2002, 2007, 2008, 2011, 2013, 2014, 2021,
              2029, 2033, 2034, 2035, 2036, 2038, 2041, 2044, 2045, 2046,
              2052, 2058, 2060, 2062, 2064, 2066, 2068, 2072, 2073, 2079,
              2083, 2087, 2089, 2093, 2096, 2097, 2098, 2100, 2101, 2102,
              2103, 2104, 2105, 2106, 2107, 2108, 2112, 2114, 2115, 2116,
              2117, 2119, 2122, 2130, 2132, 2133, 2134, 2136, 2138, 2145,
              2147, 2153, 2155, 2158, 2160, 2161, 2165, 2166, 2169, 2176,
              2180, 2186, 2193, 2197, 2199, 2203, 2206, 2207, 2211, 2214,
              2218, 2219, 2222, 2223, 2226, 2227, 2229, 2230, 2232, 2234,
              2235, 2236, 2237, 2238, 2239, 2243, 2244, 2245, 2246, 2247,
              2248, 2251, 2253, 2255, 2256, 2260, 2261, 2262, 2268, 2271,
              2276, 2278, 2279, 2284, 2285, 2288, 2293, 2295, 2297, 2298,
              2300, 2304, 2305, 2306, 2310, 2317, 2318, 2321, 2322, 2325,
              2327, 2332, 2333, 2335, 2336, 2337, 2339, 2345, 2346, 2354,
              2359, 2366, 2367, 2369, 2372, 2374, 2375, 2377, 2383, 2385,
              2387, 2388, 2389, 2390, 2391, 2393, 2394, 2395, 2399, 2400,
              2401, 2403, 2405, 2407, 2410, 2412, 2413, 2415, 2420, 2421,
              2422, 2425, 2426, 2428, 2429, 2431, 2435, 2437, 2443, 2447,
              2452, 2453, 2454, 2455, 2456, 2457, 2459, 2461, 2462, 2467,
              2469, 2476, 2477, 2481, 2485, 2486, 2487, 2497, 2499, 2501,
              2509, 2519, 2520, 2525, 2527, 2533, 2534, 2535, 2536, 2538,
              2541, 2542, 2543, 2545, 2546, 2547, 2550, 2551, 2556, 2558,
              2562, 2564, 2566, 2567, 2572, 2573, 2574, 2578, 2582, 2584,
              2585, 2587, 2588, 2590, 2591, 2596, 2597, 2600, 2602, 2605,
              2606, 2611, 2614, 2615, 2616, 2620, 2621, 2624, 2630, 2631,
              2638, 2642, 2651, 2653, 2655, 2656, 2668, 2671, 2673, 2675,
              2677, 2680, 2683, 2685, 2688, 2689, 2690, 2691, 2692, 2694,
              2695, 2701, 2703, 2705, 2706, 2707, 2708, 2710, 2711, 2712,
              2713, 2721, 2723, 2724, 2725, 2726, 2728, 2730, 2731, 2732,
              2738, 2743, 2744, 2745, 2746, 2747, 2758, 2766, 2770, 2782,
              2783, 2785, 2786, 2787, 2789, 2807, 2808, 2810, 2811, 2813,
              2817, 2822, 2823, 2824, 2827, 2832, 2833, 2834, 2835, 2837,
              2840, 2841, 2842, 2845, 2846, 2847, 2850, 2851, 2852, 2853,
              2855, 2856, 2857, 2861, 2862, 2863, 2864, 2865, 2866, 2867,
              2868, 2869, 2870, 2871, 2873, 2874, 2875, 2878, 2879, 2884,
              2885, 2886, 2888, 2889, 2890, 2895, 2903, 2904, 2905, 2909,
              2910, 2912, 2914, 2919, 2932, 2933, 2935, 2938, 2942, 2946,
              2948, 2950, 2952, 2959, 2966, 2969, 2971, 2977, 2978, 2979,
              2985, 2986, 2988, 2989, 2990, 2992, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 99,
                "sites": 891.5,
                "log_adj_pvalue": -762.592
              }
            ]
          }, {
            "db": 1,
            "id": "AARTTTAC",
            "alt": "DREME-3",
            "consensus": "AAATTTAC",
            "len": 8,
            "motif_evalue": "4.1e-188",
            "motif_nsites": 668,
            "n_tested": 146,
            "score_threshold": 5,
            "pwm": [
              [0.999892, 3.33483e-05, 3.33483e-05, 4.14908e-05], 
              [0.999892, 3.33483e-05, 3.33483e-05, 4.14908e-05], 
              [0.848716, 3.33483e-05, 0.151209, 4.14908e-05], 
              [4.14908e-05, 3.33483e-05, 3.33483e-05, 0.999892], 
              [4.14908e-05, 3.33483e-05, 3.33483e-05, 0.999892], 
              [4.14908e-05, 3.33483e-05, 3.33483e-05, 0.999892], 
              [0.999892, 3.33483e-05, 3.33483e-05, 4.14908e-05], 
              [4.14908e-05, 0.999884, 3.33483e-05, 4.14908e-05]
            ],
            "total_sites": 778,
            "sites": [
              0, 0, 0, 1.16667, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0, 1, 0, 0.5, 0,
              0, 0, 0, 0, 1, 0, 0.5, 0, 0.333333, 1, 0.333333, 1, 0, 0, 0, 2,
              0, 0, 1, 0, 1.5, 0.5, 1.5, 3.5, 0, 3.5, 3, 0, 1.5, 2.5, 2, 2, 5,
              0, 2, 2, 1, 2.5, 3, 0, 2, 1, 1, 1, 0, 2, 1, 0.5, 0, 1, 1, 0, 1,
              1, 0, 1, 2, 1, 0, 1, 1, 3.5, 0, 1, 1, 0, 2, 2, 2, 1.5, 3, 0,
              3.16667, 0, 1, 2, 2.5, 3, 5, 7, 4, 7.5, 6.5, 13, 11, 13.5, 13.5,
              16.5, 25.5, 14.5, 11.5, 23, 18.5, 18.1667, 21, 11, 8, 8, 7, 3,
              7, 7, 4, 3, 2, 7, 2, 3, 5.5, 1, 4.5, 2, 3, 1, 5.5, 4, 4, 5, 8.5,
              10, 10, 10, 13, 15.5, 19, 21.5, 16.5, 13, 12, 17.5, 19, 8, 7, 8,
              9.5, 10, 8.5, 7.5, 9, 3, 2, 5, 2, 3, 0, 2, 1, 2, 0, 1, 3, 2, 4,
              1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0.5, 1, 0, 2, 0, 0, 0, 1,
              1, 0, 2, 1, 2, 0, 3, 2.5, 2, 0, 2, 2, 2.5, 1.5, 1, 0.5, 1, 1,
              0.5, 1, 0, 1, 1, 0.5, 0, 0, 1, 0.5, 0, 0, 0, 0.5, 0, 2,
              0.166667, 0, 1, 0, 1, 0.5, 0, 0, 1, 0, 0.5, 0, 0.5, 0, 0, 0, 1,
              0, 1.33333, 0, 0.5, 0.166667, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1,
              0, 0, 0, 0, 0, 1.16667, 1, 0.5, 0, 0, 1, 0, 1
            ],
            "seqs": [
              63, 67, 244, 249, 286, 290, 291, 303, 325, 334, 350, 353, 358,
              380, 423, 446, 457, 464, 470, 528, 529, 530, 535, 544, 546, 565,
              571, 588, 595, 612, 619, 622, 633, 644, 650, 666, 685, 690, 693,
              694, 718, 724, 725, 744, 750, 758, 760, 762, 765, 766, 767, 771,
              779, 782, 804, 806, 807, 808, 812, 817, 831, 832, 849, 853, 862,
              863, 882, 885, 886, 887, 889, 903, 918, 919, 927, 937, 944, 952,
              954, 955, 959, 966, 967, 971, 980, 982, 986, 992, 996, 1026,
              1029, 1039, 1040, 1043, 1047, 1048, 1051, 1060, 1065, 1080,
              1092, 1102, 1104, 1109, 1111, 1124, 1131, 1139, 1141, 1144,
              1160, 1163, 1169, 1177, 1187, 1194, 1204, 1205, 1208, 1215,
              1221, 1223, 1227, 1228, 1232, 1236, 1246, 1248, 1257, 1263,
              1265, 1268, 1271, 1275, 1279, 1284, 1285, 1293, 1304, 1307,
              1308, 1309, 1310, 1313, 1315, 1316, 1326, 1331, 1339, 1342,
              1343, 1346, 1347, 1348, 1357, 1360, 1363, 1365, 1384, 1385,
              1391, 1407, 1408, 1422, 1427, 1433, 1435, 1438, 1441, 1444,
              1446, 1447, 1449, 1450, 1451, 1455, 1457, 1468, 1469, 1470,
              1473, 1477, 1490, 1497, 1505, 1506, 1514, 1516, 1521, 1524,
              1525, 1526, 1537, 1543, 1545, 1553, 1562, 1567, 1568, 1571,
              1582, 1584, 1585, 1589, 1592, 1594, 1600, 1601, 1604, 1605,
              1609, 1615, 1616, 1617, 1629, 1633, 1634, 1656, 1657, 1663,
              1669, 1679, 1682, 1683, 1687, 1689, 1690, 1695, 1697, 1700,
              1704, 1705, 1707, 1708, 1719, 1720, 1722, 1726, 1727, 1730,
              1735, 1744, 1747, 1749, 1753, 1756, 1768, 1769, 1773, 1775,
              1776, 1778, 1780, 1781, 1782, 1785, 1786, 1787, 1788, 1789,
              1790, 1793, 1795, 1796, 1801, 1802, 1807, 1808, 1813, 1815,
              1816, 1822, 1823, 1826, 1832, 1839, 1847, 1851, 1852, 1856,
              1859, 1862, 1866, 1869, 1882, 1902, 1910, 1913, 1921, 1927,
              1930, 1931, 1932, 1935, 1942, 1944, 1945, 1946, 1948, 1949,
              1953, 1955, 1957, 1958, 1959, 1964, 1965, 1966, 1969, 1971,
              1972, 1986, 1999, 2000, 2001, 2002, 2003, 2007, 2008, 2014,
              2021, 2033, 2034, 2036, 2038, 2041, 2045, 2046, 2052, 2058,
              2060, 2066, 2071, 2072, 2074, 2079, 2086, 2089, 2093, 2100,
              2102, 2105, 2106, 2114, 2115, 2117, 2122, 2132, 2133, 2136,
              2138, 2145, 2147, 2153, 2160, 2161, 2168, 2175, 2177, 2179,
              2186, 2193, 2197, 2203, 2211, 2212, 2213, 2214, 2217, 2223,
              2226, 2230, 2231, 2232, 2235, 2236, 2239, 2244, 2245, 2247,
              2253, 2255, 2256, 2257, 2259, 2261, 2265, 2266, 2271, 2272,
              2276, 2278, 2288, 2293, 2294, 2297, 2300, 2304, 2306, 2317,
              2318, 2325, 2327, 2332, 2333, 2335, 2336, 2337, 2340, 2341,
              2343, 2354, 2357, 2359, 2365, 2366, 2372, 2374, 2376, 2377,
              2387, 2388, 2390, 2392, 2393, 2394, 2399, 2400, 2402, 2403,
              2405, 2413, 2416, 2420, 2421, 2426, 2429, 2433, 2435, 2443,
              2445, 2447, 2453, 2454, 2456, 2457, 2459, 2462, 2467, 2469,
              2471, 2476, 2477, 2485, 2486, 2492, 2495, 2497, 2499, 2501,
              2506, 2510, 2519, 2520, 2525, 2527, 2528, 2532, 2536, 2542,
              2543, 2544, 2547, 2550, 2551, 2552, 2553, 2558, 2561, 2562,
              2564, 2566, 2567, 2583, 2585, 2589, 2590, 2591, 2596, 2598,
              2600, 2602, 2605, 2606, 2607, 2615, 2616, 2619, 2620, 2624,
              2630, 2631, 2636, 2638, 2642, 2644, 2650, 2651, 2655, 2656,
              2671, 2673, 2675, 2676, 2677, 2683, 2687, 2691, 2692, 2703,
              2704, 2705, 2706, 2711, 2713, 2714, 2719, 2723, 2726, 2738,
              2741, 2744, 2747, 2748, 2749, 2761, 2772, 2777, 2785, 2786,
              2787, 2807, 2808, 2810, 2811, 2813, 2817, 2819, 2822, 2823,
              2824, 2833, 2835, 2836, 2840, 2842, 2845, 2846, 2847, 2850,
              2851, 2853, 2855, 2861, 2862, 2864, 2865, 2868, 2869, 2876,
              2878, 2881, 2884, 2885, 2886, 2896, 2903, 2904, 2905, 2907,
              2908, 2912, 2914, 2919, 2920, 2932, 2933, 2935, 2938, 2942,
              2946, 2947, 2948, 2951, 2952, 2954, 2958, 2959, 2965, 2966,
              2969, 2978, 2979, 2984, 2990, 2992, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 63,
                "sites": 595.667,
                "log_adj_pvalue": -534.406
              }
            ]
          }, {
            "db": 1,
            "id": "GAYTTACY",
            "alt": "DREME-4",
            "consensus": "GAYTTACT",
            "len": 8,
            "motif_evalue": "1.5e-208",
            "motif_nsites": 743,
            "n_tested": 146,
            "score_threshold": 5,
            "pwm": [
              [3.73032e-05, 2.99825e-05, 0.999895, 3.73032e-05], 
              [0.999903, 2.99825e-05, 2.99825e-05, 3.73032e-05], 
              [3.73032e-05, 0.546389, 2.99825e-05, 0.453543], 
              [3.73032e-05, 2.99825e-05, 2.99825e-05, 0.999903], 
              [3.73032e-05, 2.99825e-05, 2.99825e-05, 0.999903], 
              [0.999903, 2.99825e-05, 2.99825e-05, 3.73032e-05], 
              [3.73032e-05, 0.999895, 2.99825e-05, 3.73032e-05], 
              [3.73032e-05, 0.176318, 2.99825e-05, 0.823614]
            ],
            "total_sites": 782,
            "sites": [
              0, 0, 0, 0, 0, 0, 0, 0.5, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              1, 0, 0, 1, 0, 1, 0.5, 0, 2, 0, 0.5, 1, 0, 1, 2, 0, 1, 2, 0, 2,
              2, 1, 3, 2, 1, 2, 1, 0, 2, 1, 2, 1, 2, 3, 1, 2, 1, 6, 3, 7, 3,
              8, 4, 7, 9, 7, 15, 11.5, 14, 17, 20, 23, 17, 13, 24, 20, 13, 12,
              11, 11, 8, 12, 10, 15, 12, 6, 9, 10, 16, 15, 16, 13, 19, 22, 17,
              13.5, 25, 21, 22, 26, 15, 11, 9, 8, 3, 10, 9, 5, 6, 3, 6, 1, 3,
              2, 5, 1, 1, 1, 1, 0, 2, 2, 3, 1, 3, 1, 3, 4, 0, 2, 2, 2, 2, 1,
              2, 1, 1, 0, 0, 0.5, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
              0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0,
              0, 0, 0, 1, 0, 0, 0, 2, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0
            ],
            "seqs": [
              13, 63, 244, 249, 286, 291, 303, 323, 325, 334, 344, 350, 353,
              358, 380, 423, 431, 446, 464, 513, 529, 531, 535, 544, 546, 554,
              561, 565, 571, 588, 602, 612, 619, 622, 626, 633, 642, 650, 663,
              666, 690, 693, 694, 718, 724, 744, 750, 760, 762, 765, 766, 767,
              771, 779, 799, 806, 808, 812, 817, 831, 832, 839, 848, 849, 856,
              880, 882, 886, 887, 889, 890, 903, 918, 919, 927, 937, 944, 952,
              959, 966, 971, 980, 982, 1030, 1034, 1037, 1039, 1040, 1043,
              1051, 1060, 1065, 1083, 1085, 1104, 1109, 1111, 1113, 1115,
              1124, 1125, 1126, 1130, 1131, 1139, 1141, 1144, 1150, 1163,
              1169, 1171, 1187, 1192, 1204, 1205, 1215, 1221, 1223, 1228,
              1232, 1236, 1242, 1244, 1246, 1247, 1248, 1257, 1259, 1262,
              1263, 1268, 1271, 1275, 1278, 1279, 1284, 1285, 1293, 1299,
              1304, 1307, 1308, 1309, 1310, 1313, 1315, 1326, 1331, 1332,
              1339, 1342, 1343, 1344, 1346, 1348, 1352, 1357, 1360, 1363,
              1365, 1366, 1384, 1388, 1391, 1415, 1420, 1427, 1433, 1435,
              1438, 1439, 1446, 1449, 1451, 1452, 1454, 1455, 1457, 1468,
              1469, 1473, 1477, 1490, 1491, 1497, 1505, 1506, 1514, 1516,
              1523, 1525, 1526, 1543, 1545, 1553, 1568, 1570, 1571, 1572,
              1582, 1584, 1585, 1589, 1592, 1594, 1596, 1603, 1605, 1607,
              1608, 1609, 1615, 1616, 1617, 1629, 1633, 1634, 1640, 1653,
              1655, 1656, 1657, 1663, 1669, 1672, 1679, 1682, 1683, 1684,
              1685, 1686, 1687, 1689, 1690, 1696, 1700, 1704, 1705, 1708,
              1719, 1722, 1726, 1727, 1730, 1732, 1735, 1736, 1744, 1747,
              1753, 1756, 1766, 1768, 1769, 1773, 1775, 1776, 1778, 1780,
              1781, 1782, 1783, 1786, 1787, 1788, 1789, 1790, 1793, 1796,
              1798, 1801, 1802, 1806, 1807, 1808, 1813, 1814, 1815, 1816,
              1822, 1823, 1825, 1826, 1832, 1847, 1851, 1859, 1862, 1869,
              1870, 1872, 1882, 1883, 1885, 1886, 1902, 1906, 1911, 1913,
              1921, 1927, 1930, 1931, 1935, 1938, 1942, 1944, 1945, 1946,
              1947, 1948, 1949, 1953, 1955, 1958, 1964, 1965, 1966, 1967,
              1968, 1971, 1972, 1976, 1981, 1986, 1999, 2000, 2001, 2002,
              2003, 2007, 2008, 2014, 2021, 2033, 2034, 2036, 2038, 2046,
              2052, 2058, 2060, 2062, 2064, 2071, 2072, 2085, 2086, 2087,
              2089, 2093, 2094, 2096, 2097, 2100, 2101, 2102, 2103, 2104,
              2105, 2106, 2109, 2114, 2115, 2116, 2117, 2119, 2122, 2123,
              2130, 2132, 2133, 2134, 2136, 2145, 2147, 2152, 2160, 2161,
              2167, 2168, 2171, 2175, 2177, 2179, 2186, 2187, 2193, 2197,
              2203, 2211, 2212, 2213, 2214, 2218, 2219, 2222, 2223, 2226,
              2227, 2229, 2230, 2232, 2234, 2235, 2236, 2237, 2242, 2244,
              2245, 2248, 2255, 2256, 2257, 2260, 2261, 2271, 2272, 2276,
              2278, 2284, 2293, 2294, 2297, 2298, 2300, 2304, 2306, 2317,
              2318, 2325, 2327, 2332, 2333, 2336, 2343, 2354, 2357, 2359,
              2365, 2367, 2372, 2374, 2375, 2376, 2377, 2385, 2386, 2387,
              2389, 2390, 2393, 2394, 2395, 2399, 2400, 2402, 2403, 2405,
              2407, 2410, 2412, 2413, 2414, 2420, 2421, 2426, 2428, 2429,
              2432, 2438, 2443, 2445, 2447, 2454, 2455, 2456, 2457, 2462,
              2467, 2469, 2471, 2476, 2477, 2481, 2485, 2486, 2487, 2495,
              2497, 2499, 2501, 2506, 2510, 2519, 2525, 2527, 2528, 2535,
              2536, 2541, 2542, 2543, 2544, 2545, 2547, 2550, 2551, 2553,
              2558, 2562, 2564, 2566, 2567, 2573, 2582, 2589, 2590, 2591,
              2595, 2597, 2600, 2602, 2605, 2606, 2607, 2611, 2614, 2615,
              2616, 2619, 2620, 2621, 2624, 2631, 2636, 2638, 2642, 2650,
              2651, 2653, 2656, 2667, 2671, 2673, 2676, 2677, 2680, 2681,
              2682, 2683, 2687, 2688, 2691, 2692, 2694, 2703, 2704, 2705,
              2706, 2707, 2711, 2713, 2719, 2721, 2724, 2731, 2732, 2738,
              2741, 2744, 2745, 2749, 2758, 2772, 2775, 2783, 2785, 2786,
              2787, 2789, 2807, 2808, 2810, 2813, 2815, 2817, 2819, 2823,
              2824, 2827, 2832, 2833, 2836, 2840, 2842, 2843, 2846, 2847,
              2850, 2852, 2853, 2855, 2861, 2862, 2864, 2865, 2868, 2869,
              2870, 2875, 2876, 2877, 2878, 2880, 2881, 2884, 2885, 2886,
              2888, 2896, 2903, 2904, 2905, 2907, 2908, 2912, 2914, 2919,
              2920, 2932, 2933, 2935, 2942, 2947, 2948, 2952, 2954, 2959,
              2965, 2966, 2969, 2971, 2973, 2978, 2979, 2984, 2985, 2986,
              2988, 2989, 2990, 2992, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 51,
                "sites": 653,
                "log_adj_pvalue": -814.388
              }
            ]
          }, {
            "db": 1,
            "id": "CACCYTGA",
            "alt": "DREME-5",
            "consensus": "CACCCTGA",
            "len": 8,
            "motif_evalue": "2.7e-174",
            "motif_nsites": 689,
            "n_tested": 146,
            "score_threshold": 5,
            "pwm": [
              [4.02264e-05, 0.999887, 3.2332e-05, 4.02264e-05], 
              [0.999895, 3.2332e-05, 3.2332e-05, 4.02264e-05], 
              [4.02264e-05, 0.999887, 3.2332e-05, 4.02264e-05], 
              [4.02264e-05, 0.999887, 3.2332e-05, 4.02264e-05], 
              [4.02264e-05, 0.876538, 3.2332e-05, 0.123389], 
              [4.02264e-05, 3.2332e-05, 3.2332e-05, 0.999895], 
              [4.02264e-05, 3.2332e-05, 0.999887, 4.02264e-05], 
              [0.999895, 3.2332e-05, 3.2332e-05, 4.02264e-05]
            ],
            "total_sites": 717,
            "sites": [
              0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
              1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
              0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0.5, 0, 0, 0, 1, 0, 0,
              0, 0, 0, 0, 0, 0, 0.5, 1, 0, 0, 1, 0, 1, 0, 3.5, 2, 0.5, 1, 3,
              1, 4, 3, 1, 4, 6, 3, 8.5, 3.5, 7.5, 7, 6, 13, 15, 12, 21.5, 18,
              19, 13, 15, 13.5, 18.5, 8, 7, 13, 11, 7, 7, 8, 8, 4.5, 2, 1,
              1.5, 4, 0, 2, 2, 2, 0, 3, 2, 4.5, 5, 1, 3, 0, 0, 2.5, 1, 2, 3,
              2, 2, 3, 2, 2, 0, 5, 4, 10, 5, 6.5, 6, 13, 14, 13.5, 15, 16, 22,
              14, 9.5, 27, 16, 17, 17, 13, 9, 6.5, 9, 5, 10, 11, 5.5, 5, 2,
              3.5, 4, 2, 4, 2, 2, 2, 0, 0, 0, 2, 1, 2, 1, 2.5, 0, 1, 0, 0, 0,
              0, 2, 2, 0, 0, 1, 0.5, 1, 0, 0.5, 1, 0, 0, 0.5, 0, 0, 0, 0, 0,
              0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1,
              1, 0
            ],
            "seqs": [
              13, 60, 67, 84, 122, 175, 182, 185, 188, 189, 244, 249, 279,
              286, 290, 291, 303, 325, 334, 380, 446, 457, 513, 529, 530, 531,
              535, 546, 559, 561, 565, 571, 595, 609, 612, 616, 619, 622, 626,
              628, 633, 644, 666, 685, 688, 690, 693, 718, 725, 744, 750, 758,
              760, 762, 765, 766, 771, 779, 782, 806, 807, 812, 817, 820, 830,
              839, 848, 849, 853, 859, 862, 863, 872, 880, 885, 887, 889, 903,
              907, 918, 919, 927, 937, 952, 954, 955, 959, 966, 967, 982, 986,
              992, 1031, 1039, 1040, 1048, 1051, 1060, 1065, 1080, 1083, 1085,
              1092, 1102, 1104, 1109, 1110, 1111, 1113, 1115, 1126, 1130,
              1131, 1144, 1150, 1157, 1160, 1163, 1169, 1177, 1189, 1194,
              1205, 1208, 1211, 1215, 1228, 1231, 1232, 1233, 1235, 1242,
              1244, 1246, 1248, 1257, 1262, 1263, 1265, 1271, 1275, 1277,
              1279, 1284, 1285, 1286, 1293, 1299, 1304, 1307, 1308, 1309,
              1310, 1313, 1315, 1316, 1328, 1332, 1339, 1342, 1343, 1344,
              1346, 1347, 1348, 1357, 1359, 1360, 1365, 1366, 1387, 1388,
              1407, 1408, 1420, 1422, 1427, 1433, 1435, 1438, 1439, 1441,
              1445, 1449, 1451, 1452, 1453, 1455, 1457, 1459, 1465, 1469,
              1470, 1473, 1477, 1491, 1497, 1514, 1525, 1526, 1537, 1540,
              1543, 1545, 1547, 1553, 1562, 1564, 1567, 1568, 1570, 1571,
              1580, 1584, 1585, 1589, 1592, 1600, 1604, 1607, 1609, 1615,
              1617, 1629, 1632, 1633, 1634, 1640, 1653, 1655, 1656, 1657,
              1660, 1663, 1668, 1669, 1672, 1673, 1682, 1683, 1684, 1685,
              1686, 1687, 1689, 1690, 1697, 1700, 1704, 1705, 1707, 1708,
              1719, 1720, 1722, 1726, 1727, 1732, 1735, 1736, 1744, 1745,
              1749, 1753, 1756, 1761, 1768, 1769, 1771, 1773, 1775, 1776,
              1778, 1779, 1780, 1781, 1782, 1786, 1787, 1788, 1789, 1790,
              1793, 1795, 1798, 1801, 1802, 1806, 1807, 1808, 1814, 1823,
              1825, 1826, 1827, 1846, 1847, 1850, 1851, 1859, 1862, 1866,
              1870, 1874, 1879, 1883, 1885, 1886, 1898, 1906, 1910, 1911,
              1921, 1924, 1927, 1929, 1931, 1942, 1944, 1945, 1947, 1948,
              1953, 1955, 1956, 1958, 1959, 1964, 1965, 1966, 1967, 1968,
              1986, 1996, 2000, 2001, 2002, 2007, 2014, 2021, 2033, 2034,
              2036, 2038, 2041, 2052, 2060, 2071, 2072, 2073, 2074, 2079,
              2083, 2085, 2086, 2089, 2093, 2094, 2096, 2097, 2100, 2102,
              2103, 2104, 2105, 2107, 2109, 2114, 2115, 2117, 2119, 2122,
              2123, 2133, 2145, 2147, 2154, 2160, 2161, 2166, 2167, 2169,
              2171, 2175, 2176, 2177, 2179, 2180, 2193, 2199, 2202, 2203,
              2206, 2207, 2211, 2212, 2213, 2214, 2217, 2218, 2222, 2223,
              2226, 2227, 2230, 2231, 2232, 2234, 2235, 2236, 2238, 2239,
              2243, 2244, 2245, 2246, 2247, 2251, 2252, 2255, 2256, 2257,
              2259, 2260, 2261, 2262, 2266, 2268, 2271, 2272, 2276, 2278,
              2293, 2294, 2297, 2298, 2300, 2305, 2317, 2318, 2325, 2327,
              2332, 2333, 2340, 2343, 2345, 2354, 2357, 2359, 2365, 2366,
              2367, 2372, 2374, 2375, 2377, 2383, 2385, 2387, 2388, 2389,
              2390, 2392, 2393, 2394, 2395, 2396, 2399, 2400, 2402, 2403,
              2405, 2407, 2413, 2414, 2415, 2416, 2421, 2425, 2426, 2427,
              2429, 2437, 2438, 2443, 2445, 2447, 2452, 2454, 2455, 2457,
              2459, 2461, 2462, 2467, 2471, 2477, 2483, 2485, 2486, 2494,
              2497, 2498, 2499, 2501, 2506, 2509, 2520, 2525, 2532, 2533,
              2535, 2536, 2542, 2544, 2546, 2547, 2550, 2551, 2557, 2558,
              2562, 2564, 2566, 2567, 2572, 2573, 2574, 2578, 2582, 2583,
              2589, 2591, 2595, 2599, 2602, 2605, 2606, 2607, 2611, 2619,
              2621, 2626, 2630, 2631, 2636, 2638, 2642, 2650, 2651, 2656,
              2667, 2668, 2671, 2673, 2675, 2676, 2677, 2680, 2683, 2688,
              2689, 2690, 2691, 2692, 2694, 2701, 2703, 2704, 2705, 2706,
              2710, 2711, 2712, 2713, 2714, 2719, 2721, 2723, 2724, 2726,
              2730, 2731, 2738, 2741, 2744, 2745, 2747, 2775, 2776, 2777,
              2782, 2785, 2786, 2787, 2789, 2807, 2810, 2813, 2815, 2819,
              2820, 2822, 2823, 2824, 2833, 2834, 2835, 2836, 2839, 2840,
              2841, 2842, 2843, 2845, 2846, 2847, 2850, 2853, 2855, 2856,
              2857, 2859, 2861, 2862, 2863, 2864, 2865, 2866, 2867, 2869,
              2870, 2874, 2875, 2876, 2877, 2878, 2880, 2881, 2884, 2885,
              2886, 2888, 2890, 2896, 2903, 2905, 2907, 2908, 2909, 2910,
              2912, 2914, 2919, 2920, 2932, 2933, 2938, 2942, 2946, 2954,
              2959, 2965, 2969, 2971, 2977, 2978, 2984, 2985, 2986, 2988,
              2992, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 97,
                "sites": 673,
                "log_adj_pvalue": -594.011
              }
            ]
          }
        ]
      };
    </script>
    <script type="text/javascript">
var site_url = "http://meme-suite.org";

    </script>
    <script type="text/javascript">
/*
 * $
 *
 * Shorthand function for getElementById
 */
function $(el) {
  return document.getElementById(el);
}


/*
 * See http://stackoverflow.com/a/5450113/66387
 * Does string multiplication like the perl x operator.
 */
function string_mult(pattern, count) {
    if (count < 1) return '';
    var result = '';
    while (count > 1) {
        if (count & 1) result += pattern;
        count >>= 1, pattern += pattern;
    }
    return result + pattern;
}

/*
 * See http://stackoverflow.com/questions/814613/how-to-read-get-data-from-a-url-using-javascript
 * Slightly modified with information from
 * https://developer.mozilla.org/en/DOM/window.location
 */
function parse_params() {
  "use strict";
  var search, queryStart, queryEnd, query, params, nvPairs, i, nv, n, v;
  search = window.location.search;
  queryStart = search.indexOf("?") + 1;
  queryEnd   = search.indexOf("#") + 1 || search.length + 1;
  query      = search.slice(queryStart, queryEnd - 1);

  if (query === search || query === "") return {};

  params  = {};
  nvPairs = query.replace(/\+/g, " ").split("&");

  for (i = 0; i < nvPairs.length; i++) {
    nv = nvPairs[i].split("=");
    n  = decodeURIComponent(nv[0]);
    v  = decodeURIComponent(nv[1]);
    // allow a name to be used multiple times
    // storing each value in the array
    if (!(n in params)) {
      params[n] = [];
    }
    params[n].push(nv.length === 2 ? v : null);
  }
  return params;
}

/*
 * coords
 *
 * Calculates the x and y offset of an element.
 * From http://www.quirksmode.org/js/findpos.html
 * with alterations to take into account scrolling regions
 */
function coords(elem) {
  var myX = myY = 0;
  if (elem.getBoundingClientRect) {
    var rect;
    rect = elem.getBoundingClientRect();
    myX = rect.left + ((typeof window.pageXOffset !== "undefined") ?
        window.pageXOffset : document.body.scrollLeft);
    myY = rect.top + ((typeof window.pageYOffset !== "undefined") ?
        window.pageYOffset : document.body.scrollTop);
  } else {
    // this fall back doesn't properly handle absolutely positioned elements
    // inside a scrollable box
    var node;
    if (elem.offsetParent) {
      // subtract all scrolling
      node = elem;
      do {
        myX -= node.scrollLeft ? node.scrollLeft : 0;
        myY -= node.scrollTop ? node.scrollTop : 0;
      } while (node = node.parentNode);
      // this will include the page scrolling (which is unwanted) so add it back on
      myX += (typeof window.pageXOffset !== "undefined") ? window.pageXOffset : document.body.scrollLeft;
      myY += (typeof window.pageYOffset !== "undefined") ? window.pageYOffset : document.body.scrollTop;
      // sum up offsets
      node = elem;
      do {
        myX += node.offsetLeft;
        myY += node.offsetTop;
      } while (node = node.offsetParent);
    }
  }
  return [myX, myY];
}

/*
 * position_popup
 *
 * Positions a popup relative to an anchor element.
 *
 * The available positions are:
 * 0 - Centered below the anchor.
 */
function position_popup(anchor, popup, position) {
  "use strict";
  var a_x, a_y, a_w, a_h, p_x, p_y, p_w, p_h;
  var a_xy, spacer, margin, scrollbar, page_w;
  // define constants
  spacer = 5;
  margin = 15;
  scrollbar = 15;
  // define the positions and widths
  a_xy = coords(anchor);
  a_x = a_xy[0];
  a_y = a_xy[1];
  a_w = anchor.offsetWidth;
  a_h = anchor.offsetHeight;
  p_w = popup.offsetWidth;
  p_h = popup.offsetHeight;
  page_w = null;
  if (window.innerWidth) {
    page_w = window.innerWidth;
  } else if (document.body) {
    page_w = document.body.clientWidth;
  }
  // check the position type is defined
  if (typeof position !== "number") {
    position = 0;
  }
  // calculate the popup position
  switch (position) {
    case 1:
      p_x = a_x + a_w + spacer;
      p_y = a_y + (a_h / 2) - (p_h / 2);
      break;
    case 0:
    default:
      p_x = a_x + (a_w / 2) - (p_w / 2);
      p_y = a_y + a_h + spacer;
      break;
  }
  // constrain the popup position
  if (p_x < margin) {
    p_x = margin;
  } else if (page_w != null && (p_x + p_w) > (page_w - margin - scrollbar)) {
    p_x = page_w - margin - scrollbar - p_w;
  }
  if (p_y < margin) {
    p_y = margin;
  }
  // position the popup
  popup.style.left = p_x + "px";
  popup.style.top = p_y + "px";
}

function lookup_help_popup(popup_id) {
  var _body, pop, info;
  pop = document.getElementById(popup_id);
  if (pop == null) {
    _body = document.getElementsByTagName("body")[0];
    pop = document.createElement("div");
    pop.className = "pop_content";
    pop.id = popup_id;
    pop.style.backgroundColor = "#FFC";
    pop.style.borderColor = "black";
    info = document.createElement("p");
    info.style.fontWeight = "bold";
    info.appendChild(document.createTextNode("Error: No popup for topic \"" + popup_id + "\"."));
    pop.appendChild(info);
    // this might cause problems with the menu, but as this only happens
    // when something is already wrong I don't think that's too much of a problem
    _body.insertBefore(pop, _body.firstChild);
  }
  if (document.getElementsByTagName('body')[0].hasAttribute("data-autobtns")) {
    if (!/\bauto_buttons\b/.test(pop.className)) {
      pop.className += " auto_buttons";
      var back_btn_sec = document.createElement("div");
      back_btn_sec.className = "nested_only pop_back_sec";
      var back_btn = document.createElement("span");
      back_btn.className = "pop_back";
      back_btn.appendChild(document.createTextNode("<< back"));
      back_btn.addEventListener("click", function(e) {
        help_return();
      }, false);
      back_btn_sec.appendChild(back_btn);
      pop.insertBefore(back_btn_sec, pop.firstChild);
      var close_btn_sec = document.createElement("div");
      close_btn_sec.className = "pop_close_sec";
      var close_btn = document.createElement("span");
      close_btn.className = "pop_close";
      close_btn.appendChild(document.createTextNode("close"));
      close_btn.addEventListener("click", function(e) {
        help_popup();
      }, false);
      close_btn_sec.appendChild(close_btn);
      pop.appendChild(close_btn_sec);
    }
  }
  return pop;
}

/*
 * help_popup
 *
 * Moves around help pop-ups so they appear
 * below an activator.
 */
function help_popup(activator, popup_id) {
  "use strict";
  var pop;
  // set default values
  if (typeof help_popup.popup === "undefined") {
    help_popup.popup = [];
  }
  if (typeof help_popup.activator === "undefined") {
    help_popup.activator = null;
  }
  var last_pop = (help_popup.popup.length > 0 ? help_popup.popup[help_popup.popup.length - 1] : null);
  if (typeof(activator) == "undefined") { // no activator so hide
    if (last_pop != null) {
      last_pop.style.display = 'none';
      help_popup.popup = [];
    }
    return;
  }
  pop = lookup_help_popup(popup_id);
  if (pop == last_pop) {
    if (activator == help_popup.activator) {
      //hide popup (as we've already shown it for the current help button)
      last_pop.style.display = 'none';
      help_popup.popup = [];
      return; // toggling complete!
    }
  } else if (last_pop != null) {
    //activating different popup so hide current one
    last_pop.style.display = 'none';
  }
  help_popup.popup = [pop];
  help_popup.activator = activator;
  toggle_class(pop, "nested", false);
  //must make the popup visible to measure it or it has zero width
  pop.style.display = 'block';
  position_popup(activator, pop);
}

/*
 * help_refine
 * 
 * Intended for links within a help popup. Stores a stack of state so
 * you can go back.
 */
function help_refine(popup_id) {
  if (help_popup.popup == null || help_popup.popup.length == 0 || help_popup.activator == null) {
    //throw new Error("Cannot refine a help popup when one is not shown!");
    var pop = lookup_help_popup(popup_id);
    var act_id = popup_id + '_act';
    var activator = document.getElementById(act_id);
    help_popup(activator, popup_id);
  }
  var pop = lookup_help_popup(popup_id);
  var last_pop = help_popup.popup[help_popup.popup.length - 1];
  if (pop == last_pop) return; // slightly odd, but no real cause for alarm
  help_popup.popup.push(pop);
  toggle_class(pop, "nested", true);
  last_pop.style.display = "none";
  //must make the popup visible to measure it or it has zero width
  pop.style.display = "block";
  position_popup(help_popup.activator, pop);
}

/*
 * help_return
 * 
 * Intended for links within a help popup. Stores a stack of state so
 * you can go back.
 */
function help_return() {
  if (help_popup.popup == null || help_popup.popup.length == 0 || help_popup.activator == null) {
    throw new Error("Can not return to a earlier help popup when one is not shown!");
  }
  var last_pop = help_popup.popup.pop();
  last_pop.style.display = "none";
  var pop = (help_popup.popup.length > 0 ? help_popup.popup[help_popup.popup.length - 1] : null);
  if (pop != null) {
    toggle_class(pop, "nested", help_popup.popup.length > 1);
    pop.style.display = "block";
    position_popup(help_popup.activator, pop);
  } else {
    help_popup.activator = null;
  }
}

/*
 * update_scroll_pad
 *
 * Creates padding at the bottom of the page to allow
 * scrolling of anything into view.
 */
function update_scroll_pad() {
  var page, pad;
  page = (document.compatMode === "CSS1Compat") ? document.documentElement : document.body;
  pad = $("scrollpad");
  if (pad === null) {
    pad = document.createElement("div");
    pad.id = 'scrollpad';
    document.getElementsByTagName('body')[0].appendChild(pad);
  }
  pad.style.height = Math.abs(page.clientHeight - 100) + "px";
}

function substitute_classes(node, remove, add) {
  "use strict";
  var list, all, i, cls, classes;
  list = node.className.split(/\s+/);
  all = {};
  for (i = 0; i < list.length; i++) {
    if (list[i].length > 0) all[list[i]] = true;
  }
  for (i = 0; i < remove.length; i++) {
    if (all.hasOwnProperty(remove[i])) {
      delete all[remove[i]];
    }
  }
  for (i = 0; i < add.length; i++) {
    all[add[i]] = true;
  }
  classes = "";
  for (cls in all) {
    classes += cls + " ";
  }
  node.className = classes;
}

/*
 * toggle_class
 *
 * Adds or removes a class from the node. If the parameter 'enabled' is not 
 * passed then the existence of the class will be toggled, otherwise it will be
 * included if enabled is true.
 */
function toggle_class(node, cls, enabled) {
  var classes = node.className;
  var list = classes.replace(/^\s+/, '').replace(/\s+$/, '').split(/\s+/);
  var found = false;
  for (var i = 0; i < list.length; i++) {
    if (list[i] == cls) {
      list.splice(i, 1);
      i--;
      found = true;
    }
  }
  if (typeof enabled == "undefined") {
    if (!found) list.push(cls);
  } else {
    if (enabled) list.push(cls);
  }
  node.className = list.join(" ");
}

/*
 * find_child
 *
 * Searches child nodes in depth first order and returns the first it finds
 * with the className specified.
 * TODO replace with querySelector
 */
function find_child(node, className) {
  var pattern;
  if (node == null || typeof node !== "object") {
    return null;
  }
  if (typeof className === "string") {
    pattern = new RegExp("\\b" + className + "\\b");
  } else {
    pattern = className;
  }
  if (node.nodeType == Node.ELEMENT_NODE && 
      pattern.test(node.className)) {
    return node;
  } else {
    var result = null;
    for (var i = 0; i < node.childNodes.length; i++) {
      result = find_child(node.childNodes[i], pattern);
      if (result != null) break;
    }
    return result;
  }
}

/*
 * find_parent
 *
 * Searches parent nodes outwards from the node and returns the first it finds
 * with the className specified.
 */
function find_parent(node, className) {
  var pattern;
  pattern = new RegExp("\\b" + className + "\\b");
  do {
    if (node.nodeType == Node.ELEMENT_NODE && 
        pattern.test(node.className)) {
      return node;
    }
  } while (node = node.parentNode);
  return null;
}

/*
 * find_parent_tag
 *
 * Searches parent nodes outwards from the node and returns the first it finds
 * with the tag name specified. HTML tags should be specified in upper case.
 */
function find_parent_tag(node, tag_name) {
  do {
    if (node.nodeType == Node.ELEMENT_NODE && node.tagName == tag_name) {
      return node;
    }
  } while (node = node.parentNode);
  return null;
}

/*
 * __toggle_help
 *
 * Uses the 'topic' property of the this object to
 * toggle display of a help topic.
 *
 * This function is not intended to be called directly.
 */
function __toggle_help(e) {
  if (!e) e = window.event;
  if (e.type === "keydown") {
    if (e.keyCode !== 13 && e.keyCode !== 32) {
      return;
    }
    // stop a submit or something like that
    e.preventDefault();
  }

  help_popup(this, this.getAttribute("data-topic"));
}

function setup_help_button(button) {
  "use strict";
  var topic;
  if (button.hasAttribute("data-topic")) {
    topic = button.getAttribute("data-topic");
    if (document.getElementById(topic) != null) {
      button.tabIndex = "0"; // make keyboard selectable
      button.addEventListener("click", function() {
        help_popup(button, topic);
      }, false);
      button.addEventListener("keydown", function(e) {
        // toggle only on Enter or Spacebar, let other keys do their thing
        if (e.keyCode !== 13 && e.keyCode !== 32) return;
        // stop a submit or something like that
        e.preventDefault();
        help_popup(button, topic);
      }, false);
    } else {
      button.style.visibility = "hidden";
    }
  }
  button.className += " active";
}

/*
 * help_button
 *
 * Makes a help button for the passed topic.
 */
function help_button(topic) {
  var btn = document.createElement("div");
  btn.className = "help";
  btn.setAttribute("data-topic", topic);
  setup_help_button(btn);
  return btn;
}

/*
 * prepare_download
 *
 * Sets the attributes of a link to setup a file download using the given content.
 * If no link is provided then create one and click it.
 */
function prepare_download(content, mimetype, filename, link) {
  "use strict";
  // if no link is provided then create one and click it
  var click_link = false;
  if (!link) {
    link = document.createElement("a");
    click_link = true;
  }
  try {
    // Use a BLOB to convert the text into a data URL.
    // We could do this manually with a base 64 conversion.
    // This will only be supported on modern browsers,
    // hence the try block.
    var blob = new Blob([content], {type: mimetype});
    var reader = new FileReader();
    reader.onloadend = function() {
      // If we're lucky the browser will also support the download
      // attribute which will let us suggest a file name to save the link.
      // Otherwise it is likely that the filename will be unintelligible. 
      link.setAttribute("download", filename);
      link.href = reader.result;
      if (click_link) {
        // must add the link to click it
        document.body.appendChild(link);
        link.click();
        document.body.removeChild(link);
      }
    }
    reader.readAsDataURL(blob);
  } catch (error) {
    if (console && console.log) console.log(error);
    // probably an old browser
    link.href = "";
    link.visible = false;
  }
}

/*
 * add_cell
 *
 * Add a cell to the table row.
 */
function add_cell(row, node, cls, click_action) {
  var cell = row.insertCell(row.cells.length);
  if (node) cell.appendChild(node);
  if (cls && cls !== "") cell.className = cls;
  if (click_action) cell.addEventListener("click", click_action, false);
}

/*
 * add_header_cell
 *
 * Add a header cell to the table row.
 */
function add_header_cell(row, node, help_topic, cls, colspan) {
  var th = document.createElement("th");
  if (node) th.appendChild(node);
  if (help_topic && help_topic !== "") th.appendChild(help_button(help_topic));
  if (cls && cls !== "") th.className = cls;
  if (typeof colspan == "number" && colspan > 1) th.colSpan = colspan;
  row.appendChild(th);
}

/*
 * add_text_cell
 *
 * Add a text cell to the table row.
 */
function add_text_cell(row, text, cls, action) {
  var node = null;
  if (typeof(text) != 'undefined') node = document.createTextNode(text);
  add_cell(row, node, cls, action);
}

/*
 * add_text_header_cell
 *
 * Add a text header cell to the table row.
 */
function add_text_header_cell(row, text, help_topic, cls, action, colspan) {
  var node = null;
  if (typeof(text) != 'undefined') {
    var nbsp = (help_topic ? "\u00A0" : "");
    var str = "" + text;
    var parts = str.split(/\n/);
    if (parts.length === 1) {
      if (action) {
        node = document.createElement("span");
        node.appendChild(document.createTextNode(str + nbsp));
      } else {
        node = document.createTextNode(str + nbsp);
      }
    } else {
      node = document.createElement("span");
      for (var i = 0; i < parts.length; i++) {
        if (i !== 0) {
          node.appendChild(document.createElement("br"));
        }
        node.appendChild(document.createTextNode(parts[i]));
      }
    }
    if (action) {
      node.addEventListener("click", action, false);
      node.style.cursor = "pointer";
    }
  }
  add_header_cell(row, node, help_topic, cls, colspan);
}

function setup_help() {
  "use strict";
  var help_buttons, i;
  help_buttons = document.querySelectorAll(".help:not(.active)");
  for (i = 0; i < help_buttons.length; i++) {
    setup_help_button(help_buttons[i]);
  }
}

function setup_scrollpad() {
  "use strict";
  if (document.getElementsByTagName('body')[0].hasAttribute("data-scrollpad") && document.getElementById("scrollpad") == null) {
    window.addEventListener("resize", update_scroll_pad, false);
    update_scroll_pad();
  }
}

// anon function to avoid polluting global scope
(function() {
  "use strict";
  window.addEventListener("load", function load(evt) {
    window.removeEventListener("load", load, false);
    setup_help();
    setup_scrollpad();
  }, false);
})();

/*
 *  make_link
 *
 *  Creates a text node and if a URL is specified it surrounds it with a link.
 *  If the URL doesn't begin with "http://" it automatically adds it, as
 *  relative links don't make much sense in this context.
 */
function make_link(text, url) {
  var textNode = null;
  var link = null;
  if (typeof text !== "undefined" && text !== null) textNode = document.createTextNode(text);
  if (typeof url === "string") {
    if (url.indexOf("//") == -1) {
      url = "http://" + url;
    }
    link = document.createElement('a');
    link.href = url;
    if (textNode) link.appendChild(textNode);
    return link;
  }
  return textNode;
}

//
// Function to create an HTML paragraph describing the 
// MEME Suite background model source.
//
function make_background_source(title, source, text) {
  var paraNode = document.createElement("P");
  var titleNode = document.createElement("B");
  var textNode1 = document.createTextNode("\u00A0\u00A0\u00A0\u00A0" + title + ": ");
  titleNode.appendChild(textNode1);
  var source_text = ((source == "--motif--") ? "the (first) motif file" : (source == "--nrdb--") ? "an old version of the NCBI non-redundant database" : (source == "--uniform--") ? "the uniform model" : (source == "--query--") ? "the query file" : (source == "--sequences--") ? "built from the (primary) sequences" : ("the file '" + source + "'"));
  if (text) { return source_text; }
  var textNode2 = document.createTextNode(source_text);
  paraNode.appendChild(titleNode);
  paraNode.appendChild(textNode2);
  return paraNode;
}

// Function to create a help button
function make_help_button(container, help_topic) {
  container.appendChild(help_button(help_topic));
}

    </script>
    <script type="text/javascript">
function rad2deg(rad) {
  return rad * 180 / Math.PI;
}

function parse_line_join(line_join) {
  line_join = line_join.toLowerCase();
  if (line_join == "bevel") {
    return 2;
  } else if (line_join == "round") {
    return 1;
  } else { // miter
    return 0;
  }
}

function parse_line_cap(line_cap) {
  line_cap = line_cap.toLowerCase();
  if (line_cap == "square") {
    return 2;
  } else if (line_cap == "round") {
    return 1;
  } else { // butt 
    return 0;
  }
}

function parse_text_align(text_align) {
  text_align = text_align.toLowerCase();
  if (text_align == "center") {
    return "center";
  } else if (text_align == "end" || text_align == "right") {
    return "right"; 
  } else { // start or left
    return "left";
  }
}

function parse_text_baseline(text_baseline) {
  text_baseline = text_baseline.toLowerCase();
  if (text_baseline == "top" || text_baseline == "hanging") {
    return "top";
  } else if (text_baseline == "middle") {
    return "middle";
  } else if (text_baseline == "bottom") {
    return "bottom";
  } else { // alphabetic or ideographic
    return "alphabetic";
  }
}

function parse_colour(colour) {
  var hex6_re = /^#([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/;
  var hex3_re = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/;
  var rgb_re = /^\s*rgb\s*\(\s*(\d{1,3})(%?)\s*,\s*(\d{1,3})(%?)\s*,\s*(\d{1,3})(%?)\s*\)\s*$/;
  var rgba_re = /^\s*rgba\s*\(\s*(\d{1,3})(%?)\s*,\s*(\d{1,3})(%?)\s*,\s*(\d{1,3})(%?)\s*,\s*(\d{1,3})(%?)\s*\)\s*$/;
  if (colour == null || colour == "") {
    return {'red': 0, 'green': 0, 'blue': 0, 'alpha': 255};
  }
  colour = colour.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); //trim
  colour = colour.toLowerCase();
  if (colour == "maroon") {// #800000
    return {'red': 128, 'green': 0, 'blue': 0, 'alpha': 255};
  } else if (colour == "red") { // #FF0000
    return {'red': 255, 'green': 0, 'blue': 0, 'alpha': 255};
  } else if (colour == "orange") { // FFA500
    return {'red': 255, 'green': 165, 'blue': 0, 'alpha': 255};
  } else if (colour == "yellow") { // #FFFF00
    return {'red': 255, 'green': 255, 'blue': 0, 'alpha': 255};
  } else if (colour == "olive") { // #808000
    return {'red': 128, 'green': 128, 'blue': 0, 'alpha': 255};
  } else if (colour == "purple") { // #800080
    return {'red': 128, 'green': 0, 'blue': 128, 'alpha': 255};
  } else if (colour == "fuchsia" || colour == "magenta") { // #FF00FF
    return {'red': 255, 'green': 0, 'blue': 255, 'alpha': 255};
  } else if (colour == "white") { // #FFFFFF
    return {'red': 255, 'green': 255, 'blue': 255, 'alpha': 255};
  } else if (colour == "lime") { // #00FF00
    return {'red': 0, 'green': 255, 'blue': 0, 'alpha': 255};
  } else if (colour == "green") { // #008000
    return {'red': 0, 'green': 128, 'blue': 0, 'alpha': 255};
  } else if (colour == "navy") { // #000080
    return {'red': 0, 'green': 0, 'blue': 128, 'alpha': 255};
  } else if (colour == "blue") { // #0000FF
    return {'red': 0, 'green': 0, 'blue': 255, 'alpha': 255};
  } else if (colour == "aqua" || colour == "cyan") { // #00FFFF
    return {'red': 0, 'green': 255, 'blue': 255, 'alpha': 255};
  } else if (colour == "teal") { // #008080
    return {'red': 0, 'green': 128, 'blue': 128, 'alpha': 255};
  } else if (colour == "black") { // #000000
    return {'red': 0, 'green': 0, 'blue': 0, 'alpha': 255};
  } else if (colour == "silver") { // #C0C0C0
    return {'red': 192, 'green': 192, 'blue': 192, 'alpha': 255};
  } else if (colour == "gray") { // #808080
    return {'red': 128, 'green': 128, 'blue': 128, 'alpha': 255};
  }
  var matches;
  matches = hex6_re.exec(colour);
  if (matches) {
    var red = parseInt(matches[1], 16);
    var green = parseInt(matches[2], 16);
    var blue = parseInt(matches[3], 16);
    return {'red': red, 'green': green, 'blue': blue, 'alpha': 255};
  }
  matches = hex3_re.exec(colour);
  if (matches) {
    var red = parseInt(matches[1] + matches[1], 16);
    var green = parseInt(matches[2] + matches[2], 16);
    var blue = parseInt(matches[3] + matches[3], 16);
    return {'red': red, 'green': green, 'blue': blue, 'alpha': 255};
  }
  matches = rgb_re.exec(colour);
  if (matches) {
    var red = parseInt(matches[1]);
    if (matches[2] == "%") red = Math.round((red * 255) / 100);
    var green = parseInt(matches[3]);
    if (matches[4] == "%") green = Math.round((green * 255) / 100);
    var blue = parseInt(matches[5]);
    if (matches[6] == "%") blue = Math.round((blue * 255) / 100);
    return {'red': red, 'green': green, 'blue': blue, 'alpha': 255};
  }
  matches = rgba_re.exec(colour);
  if (matches) {
    var red = parseInt(matches[1]);
    if (matches[2] == "%") red = Math.round((red * 255) / 100);
    var green = parseInt(matches[3]);
    if (matches[4] == "%") green = Math.round((green * 255) / 100);
    var blue = parseInt(matches[5]);
    if (matches[6] == "%") blue = Math.round((blue * 255) / 100);
    var alpha = parseInt(matches[7]);
    if (matches[8] == "%") alpha = Math.round((alpha * 255) / 100);
    return {'red': red, 'green': green, 'blue': blue, 'alpha': alpha};
  }
  // default to black
  throw new Error("Failed to parse colour: " + colour);
}

function colour_equals(colour1, colour2) {
  if (colour1.red != colour2.red) return false;
  if (colour1.green != colour2.green) return false;
  if (colour1.blue != colour2.blue) return false;
  if (colour1.alpha != colour2.alpha) return false;
  return true;
}

// splits a font string into words
function split_words(str) {
  var words = [];
  var start = -1;
  var space = /\s/;
  var single_quote = false;
  var double_quote = false;
  // read words
  for (var i = 0; i < str.length; i++) {
    if (start == -1) {
      if (!space.test(str.charAt(i))) {
        switch (str.charAt(i)) {
          case "'":
            single_quote = true;
            start = i + 1;
            break;
          case '"':
            double_quote = true;
            start = i + 1;
            break;
          default:
            start = i;
        }
      }
    } else {
      if (!single_quote && !double_quote) {
        if (space.test(str.charAt(i))) {
          var len = i - start;
          if (len > 0) words.push(str.substr(start, len));
          start = -1;
        } else if (str.charAt(i) == "'" || str.charAt(i) == '"') {
          throw new Error("Quote in the middle of an unquoted word!");
        }
      } else if (single_quote) {
        if (str.charAt(i) == "'") {
          var len = i - start;
          if (len > 0) words.push(str.substr(start, len));
          start = -1;
          single_quote = false;
        }
      } else if (double_quote) {
        if (str.charAt(i) == '"') {
          var len = i - start;
          if (len > 0) words.push(str.substr(start, len));
          start = -1;
          double_quote = false;
        }
      }
    }
  }
  if (start != -1) {
    if (single_quote || double_quote) throw new Error("Unterminated quoted region");
    words.push(str.substr(start));
  }
  return words;
}

function add_intercepts(ctx2d, eps_callback) {
  ctx2d.eps_callback = eps_callback;
  ctx2d.save = function() {
    this.eps_callback.save();
    Object.getPrototypeOf(this).save.call(this);
  };
  ctx2d.restore = function() {
    this.eps_callback.restore();
    Object.getPrototypeOf(this).restore.call(this);
  };
  ctx2d.beginPath = function() {
    this.eps_callback.beginPath();
    Object.getPrototypeOf(this).beginPath.call(this);
  };
  ctx2d.closePath = function() {
    this.eps_callback.closePath();
    Object.getPrototypeOf(this).closePath.call(this);
  };
  ctx2d.moveTo = function(x, y) {
    this.eps_callback.moveTo(x, y);
    Object.getPrototypeOf(this).moveTo.call(this, x, y);
  };
  ctx2d.lineTo = function(x, y) {
    this.eps_callback.lineTo(x, y);
    Object.getPrototypeOf(this).lineTo.call(this, x, y);
  };
  ctx2d.rect = function(x, y, w, h) {
    this.eps_callback.rect(x, y, w, h);
    Object.getPrototypeOf(this).rect.call(this, x, y, w, h);
  };
  ctx2d.arc = function(x, y, radius, startAngle, endAngle, anticlockwise) {
    this.eps_callback.arc(x, y, radius, startAngle, endAngle, anticlockwise);
    Object.getPrototypeOf(this).arc.call(this, x, y, radius, startAngle, endAngle, anticlockwise);
  };
  ctx2d.arcTo = function(cpx1, cpy1, cpx2, cpy2, radius) {
    this.eps_callback.arcTo(cpx1, cpy1, cpx2, cpy2, radius);
    Object.getPrototypeOf(this).arcTo.call(this, cpx1, cpy1, cpx2, cpy2, radius);
  };
  ctx2d.quadraticArcTo = function(cpx, cpy, x, y) {
    this.eps_callback.quadraticArcTo(cpx, cpy, x, y);
    Object.getPrototypeOf(this).quadraticArcTo.call(this, cpx, cpy, x, y);
  };
  ctx2d.bezierCurveTo = function(cp1x, cp1y, cp2x, cp2y, x, y) {
    this.eps_callback.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
    Object.getPrototypeOf(this).bezierCurveTo.call(this, cp1x, cp1y, cp2x, cp2y, x, y);
  };
  ctx2d.stroke = function() {
    this.eps_callback.stroke();
    Object.getPrototypeOf(this).stroke.call(this);
  };
  ctx2d.fill = function() {
    this.eps_callback.fill();
    Object.getPrototypeOf(this).fill.call(this);
  };
  ctx2d.clip = function() {
    this.eps_callback.clip();
    Object.getPrototypeOf(this).clip.call(this);
  };
  ctx2d.fillRect = function(x, y, width, height) {
    this.eps_callback.fillRect(x, y, width, height);
    Object.getPrototypeOf(this).fillRect.call(this, x, y, width, height);
  };
  ctx2d.strokeRect = function(x, y, width, height) {
    this.eps_callback.strokeRect(x, y, width, height);
    Object.getPrototypeOf(this).strokeRect.call(this, x, y, width, height);
  };
  ctx2d.clearRect = function(x, y, width, height) {
    this.eps_callback.clearRect(x, y, width, height);
    Object.getPrototypeOf(this).clearRect.call(this, x, y, width, height);
  };
  ctx2d.fillText = function(string, x, y) {
    this.eps_callback.fillText(string, x, y);
    Object.getPrototypeOf(this).fillText.call(this, string, x, y);
  };
  ctx2d.translate = function(dx, dy) {
    this.eps_callback.translate(dx, dy);
    Object.getPrototypeOf(this).translate.call(this, dx, dy);
  };
  ctx2d.rotate = function(angle) {
    this.eps_callback.rotate(angle);
    Object.getPrototypeOf(this).rotate.call(this, angle);
  };
  ctx2d.scale = function(sx, sy) {
    this.eps_callback.scale(sx, sy);
    Object.getPrototypeOf(this).scale.call(this, sx, sy);
  };
  ctx2d.transform = function(m11, m12, m21, m22, dx, dy) {
    this.eps_callback.transform(m11, m12, m21, m22, dx, dy);
    Object.getPrototypeOf(this).transform.call(this, m11, m12, m21, m22, dx, dy);
  };
  ctx2d.setTransform = function(m11, m12, m21, m22, dx, dy) {
    this.eps_callback.setTransform(m11, m12, m21, m22, dx, dy);
    Object.getPrototypeOf(this).setTransform.call(this, m11, m12, m21, m22, dx, dy);
  };
}

var EpsState = function(copy) {
  // canvas vars
  this.activeStyle = {'red': 0, 'green': 0, 'blue': 0, 'alpha': 255};
  this.fillStyle = {'red': 0, 'green': 0, 'blue': 0, 'alpha': 255};
  this.strokeStyle = {'red': 0, 'green': 0, 'blue': 0, 'alpha': 255};
  this.lineWidth = 1.0;
  this.lineCap = 0;
  this.lineJoin = 0;
  this.miterLimit = 10.0;
  this.font = null;
  this.textAlign = "left";
  this.textBaseline = "alphabetic";
  if (copy) {
    this.activeStyle = copy.activeStyle;
    this.fillStyle = copy.fillStyle;
    this.strokeStyle = copy.strokeStyle;
    this.lineWidth = copy.lineWidth;
    this.lineCap = copy.lineCap;
    this.lineJoin = copy.lineJoin;
    this.miterLimit = copy.miterLimit;
    this.font = copy.font;
    this.textAlign = copy.textAlign;
    this.textBaseline = copy.textBaseline;
  }
};


var EpsContext = function(ctx, width, height) {
  var title = "Image Title";
  var creator = "Image Creator";
  var date = new Date();
  // private parameters
  this.ctx = ctx;
  this.width = width;
  this.height = height;
  this.stack = [];
  this.current_state = new EpsState();
  this.font_lookup = {};
  this.indent = "";
  this.eps_text = 
    "%!PS-Adobe-3.0 EPSF-3.0\n" + 
    "%%Title: " + title + "\n" + 
    "%%Creator: " + creator + "\n" +
    "%%CreationDate: " + date.toUTCString() + "\n" + 
    "%%BoundingBox: 0 0 " + (width * 0.75) + " " + (height * 0.75) + "\n" +
    "%%Pages: 0\n" +
    "%%DocumentFonts:\n" +
    "%%EndComments\n" +
    "0.75 0.75 scale\n" +
    "0 " + height + " translate\n" + 
    "1 -1 scale\n";
  add_intercepts(ctx, this);
};

// look for differences between the current state and the settings to see 
// what has changed. Apply the changes to the eps file.
EpsContext.prototype.detect = function() {
  var state = this.current_state;
  var ctx = this.ctx;
  if (ctx.lineWidth != state.lineWidth) {
    state.lineWidth = ctx.lineWidth;
    this.eps_text += this.indent + state.lineWidth + " setlinewidth\n";
  }
  var cap = parse_line_cap(ctx.lineCap);
  if (cap != state.lineCap) {
    state.lineCap = cap;
    this.eps_text += this.indent + state.lineCap + " setlinecap\n";
  }
  var join = parse_line_join(ctx.lineJoin);
  if (join != state.lineJoin) {
    state.lineJoin = join;
    this.eps_text += this.indent + state.lineJoin + " setlinejoin\n";
  }
  var miterLimit = parseInt(ctx.miterLimit);
  if (miterLimit != state.miterLimit) {
    state.miterLimit = miterLimit;
    this.eps_text += this.indent + state.miterLimit + " setmiterlimit\n";
  }
  var strokeStyle = parse_colour(ctx.strokeStyle);
  if (!colour_equals(strokeStyle, state.strokeStyle)) {
    state.strokeStyle = strokeStyle;
    this.activateStyle(false);
  }
  var fillStyle = parse_colour(ctx.fillStyle);
  if (!colour_equals(fillStyle, state.fillStyle)) {
    state.fillStyle = fillStyle;
    this.activateStyle(true);
  }
  var textAlign = parse_text_align(ctx.textAlign);
  if (textAlign != state.textAlign) {
    state.textAlign = textAlign;
  }
  var textBaseline = parse_text_baseline(ctx.textBaseline);
  if (textBaseline != state.textBaseline) {
    state.textBaseline = textBaseline;
  }
  var font = this.lookup_font(ctx.font);
  if (font != null && font !== state.font) {
    state.font = font;
    this.eps_text += this.indent + "/" + font.name + " findfont " +  
      font.size + " scalefont setfont\n";
  }
};

EpsContext.prototype.activateStyle = function(useFillStyle) {
  var state = this.current_state;
  var style = (useFillStyle ? state.fillStyle : state.strokeStyle);
  if (!colour_equals(state.activeStyle, style)) {
    this.eps_text += this.indent + (style.red / 255) + " " + 
      (style.green / 255) + " " + (style.blue / 255) + " setrgbcolor\n";
    state.activeStyle = style;
  }
};


// saves the current state on the stack
EpsContext.prototype.save = function() {
  this.detect();
  // gsave
  this.eps_text += this.indent + "gsave\n";
  this.stack.push(new EpsState(this.current_state));
  this.indent += "  ";
};

// restores the last saved state
EpsContext.prototype.restore = function() {
  if (this.stack.length == 0) throw new Error("Call to restore not matched with call to save.");
  this.detect();
  this.current_state = this.stack.pop();
  this.indent = Array(this.stack.length + 1).join("  ");
  // grestore
  this.eps_text += this.indent + "grestore\n";
};

// start a path
EpsContext.prototype.beginPath = function() {
  this.detect();
  // newpath
  this.eps_text += this.indent + "newpath\n";
};

// join the current position to the path start
EpsContext.prototype.closePath = function() {
  this.detect();
  // closepath
  this.eps_text += this.indent + "closepath\n";
};

// move the current position
EpsContext.prototype.moveTo = function(x, y) {
  this.detect();
  // moveto
  this.eps_text += this.indent + x + " " + y + " moveto\n";
};

// join the current position to a new position and update the current position
EpsContext.prototype.lineTo = function(x, y) {
  this.detect();
  // lineto
  this.eps_text += this.indent + x + " " + y + " lineto\n";
};

// add a rectangle to the path
EpsContext.prototype.rect = function(x, y, width, height) {
  this.moveTo(x, y);
  this.lineTo(x + width, y);
  this.lineTo(x + width, y + height);
  this.lineTo(x, y + height);
  this.closePath();
};

// add an arc to the path
EpsContext.prototype.arc = function(x, y, radius, startAngle, endAngle, anticlockwise) {
  this.detect();
  if (anticlockwise) {
    // command "X Y RADIUS START_ANGLE END_ANGLE arc"
    this.eps_text += this.indent + x + " " + y + " " + radius + " " + rad2deg(startAngle) + " " + rad2deg(endAngle) + " arcn\n";
  } else {
    // command "X Y RADIUS START_ANGLE END_ANGLE arcn"
    this.eps_text += this.indent + x + " " + y + " " + radius + " " + rad2deg(startAngle) + " " + rad2deg(endAngle) + " arc\n";
  }
};

// imagine two lines, one going from the current position to point 1 and
// another going from point 1 to point 2. 
// Now imagine a circle of the given radius which touches the two lines at at 
// two tangental points T01 and T12. Add a line to the path that goes from
// the current position to T01 and add the arc which goes from T01 to T12.
// see http://www.dbp-consulting.com/tutorials/canvas/CanvasArcTo.html
EpsContext.prototype.arcTo = function(cpx1, cpy1, cpx2, cpy2, radius) {
  this.detect();
  // command "X1 Y1 X2 Y2 RADIUS arct"
  this.eps_text += this.indent + cpx1 + " " + cpy1 + " " + cpx2 + " " + cpy2 + " " + radius + " arct\n";
};

EpsContext.prototype.quadraticArcTo = function(cpx, cpy, x, y) {
  /* 
   For the equations below the following variable name prefixes are used: 
     qp0 is the quadratic curve starting point (you must keep this from your 
        last point sent to moveTo(), lineTo(), or bezierCurveTo() ). 
     qp1 is the quadratic curve control point (this is the cpx,cpy you would 
        have sent to quadraticCurveTo() ). 
     qp2 is the quadratic curve ending point (this is the x,y arguments you 
        would have sent to quadraticCurveTo() ). 
   We will convert these points to compute the two needed cubic control points 
    (the starting/ending points are the same for both 
   the quadratic and cubic curves. 
 
   The exact equations for the two cubic control points are: 
     cp0 = qp0 and cp3 = qp2 
     cp1 = qp0 + (qp1 - qp0) * ratio 
     cp2 = cp1 + (qp2 - qp0) * (1 - ratio) 
     where ratio = (sqrt(2) - 1) * 4 / 3 exactly (approx. 0.5522847498307933984022516322796) 
                   if the quadratic is an approximation of an elliptic arc, 
                      and the cubic must approximate the same arc, or 
           ratio = 2.0 / 3.0 for keeping the same quadratic curve. 
 
   In the code below, we must compute both the x and y terms for each point separately. 
 
    cp1x = qp0x + (qp1x - qp0x) * ratio; 
    cp1y = qp0y + (qp1y - qp0y) * ratio; 
    cp2x = cp1x + (qp2x - qp0x) * (1 - ratio); 
    cp2y = cp1y + (qp2y - qp0y) * (1 - ratio); 
 
   We will now  
     a) replace the qp0x and qp0y variables with currentX and currentY 
        (which *you* must store for each moveTo/lineTo/bezierCurveTo) 
     b) replace the qp1x and qp1y variables with cpx and cpy (which we would 
        have passed to quadraticCurveTo) 
     c) replace the qp2x and qp2y variables with x and y. 
   which leaves us with:  
  */  
  var ratio = 2.0 / 3.0; // 0.5522847498307933984022516322796 if the Bezier is 
                        // approximating an elliptic arc with best fitting  
  var cp1x = this.currentX + (cpx - this.currentX) * ratio;  
  var cp1y = this.currentY + (cpy - this.currentY) * ratio;  
  var cp2x = cp1x + (x - this.currentX) * (1 - ratio);  
  var cp2y = cp1y + (y - this.currentY) * (1 - ratio);  
  
  // and now call cubic Bezier curve to function   
  this.bezierCurveTo( cp1x, cp1y, cp2x, cp2y, x, y );
};

// add a bezier curve to the path
EpsContext.prototype.bezierCurveTo = function(cp1x, cp1y, cp2x, cp2y, x, y) {
  this.detect();
  // command "CP1X CP1Y CP2X CP2Y X Y curveto"
  this.eps_text += this.indent + cp1x + " " + cp1y + " " + cp2x + " " + cp2y + " " + x + " " + y + " curveto";
};

// stroke the current path
EpsContext.prototype.stroke = function() {
  this.detect();
  this.activateStyle(false);
  // stroke
  this.eps_text += this.indent + "stroke\n";
};

// fill the current path
EpsContext.prototype.fill = function() {
  this.detect();
  this.activateStyle(true);
  // fill
  this.eps_text += this.indent + "fill\n";
};

// create a clipping region from the current path
EpsContext.prototype.clip = function() {
  this.detect();
  // clip
  this.eps_text += this.indent + "clip\n";
};

// Draws a filled rectangle
EpsContext.prototype.fillRect = function(x, y, width, height) {
  this.detect();
  this.activateStyle(true);
  // rectfill
  this.eps_text += this.indent + x + " " + y + " " + width + " " + height + " rectfill\n";
};

// Draws a rectangular outline
EpsContext.prototype.strokeRect = function(x, y, width, height) {
  this.detect();
  this.activateStyle(false);
  // rectstroke
  this.eps_text += this.indent + x + " " + y + " " + width + " " + height + " rectstroke\n";
};

// Clears the specified area and makes it transparent.
EpsContext.prototype.clearRect = function(x, y, width, height) {
  this.detect();
  // fill a rectangle with white in the cleared region
  // EPS doesn't do transparency so this is as close as it can get
  // command "1 setgray X Y WIDTH HEIGHT rectfill"
  this.eps_text += this.indent + "gsave\n";
  this.eps_text += this.indent + "  1 setgray\n";
  this.eps_text += this.indent + "  " + x + " " + y + " " + width + " " + height + " rectfill\n";
  this.eps_text += this.indent + "grestore\n";
};

// Draws a filled string
EpsContext.prototype.fillText = function(string, x, y) {
  var state = this.current_state;
  this.detect();
  this.activateStyle(true);
  // lookup the font with "/FONT_NAME findfont" (leaves FONT on stack)
  // scale the font with "FONT SIZE scalefont" (leaves FONT on stack
  // set the font with "FONT setfont"
  // move the printing location with "X Y moveto"
  // various measurement commands will be needed to do center alignment etc
  // like "stringwidth"
  // show the text with "(STRING) show"
  string = string.replace(/\\/g, "\\\\");
  string = string.replace(/\(/g, "\\(");
  string = string.replace(/\)/g, "\\)");
  this.save();
  this.translate(x, y);
  this.scale(1, -1);
  this.eps_text += this.indent + "(" + string + ")\n";
  if (state.textBaseline != "alphabetic") {
    this.beginPath();
    this.moveTo(0,0);
    this.eps_text += this.indent + "dup true charpath flattenpath pathbbox %bounding box\n";
    this.eps_text += this.indent + "/ascent exch def pop /decent exch def pop\n";
    if (state.textBaseline == "top") {
      this.eps_text += this.indent + "0 ascent neg translate %vertical align top\n";
    } else if (state.textBaseline == "middle") {
      this.eps_text += this.indent + "0 ascent decent sub 2 div decent sub neg translate %vertical align middle\n";
    } else if (state.textBaseline == "bottom") {
      this.eps_text += this.indent + "0 decent neg translate %vertical align bottom\n";
    }
  }
  if (state.textAlign == "right") {
    this.eps_text += this.indent + "dup stringwidth pop neg 0 translate %right align\n"  
  } else if (state.textAlign == "center") {
    this.eps_text += this.indent + "dup stringwidth pop 2 div neg 0 translate %center align\n"  
  }
  this.moveTo(0,0);
  this.eps_text += this.indent + "show\n";
  this.restore();
};

// move the canvas origin
EpsContext.prototype.translate = function(dx, dy) {
  this.detect();
  // command "DELTA_X DELTA_Y translate"
  this.eps_text += this.indent + dx + " " + dy + " translate\n";
};

// rotate around the canvas origin
EpsContext.prototype.rotate = function(angle) {
  this.detect();
  // command "DEGREES rotate" (note need to convert angle from radians to degrees)
  this.eps_text += this.indent + rad2deg(angle) + " rotate\n";
};

// scale 
EpsContext.prototype.scale = function(scale_x, scale_y) {
  this.detect();
  // command "SCALE_X SCALE_Y scale
  this.eps_text += this.indent + scale_x + " " + scale_y + " scale\n";
};

// multiplies the current transform matrix by the matrix described by:
// m11    m21   dx
// m12    m22   dy
// 0      0     1
EpsContext.prototype.transform = function(m11, m12, m21, m22, dx, dy) {
  this.detect();
  // command "[M11 M12 M21 M22 DX DY] concat"
  this.eps_text += this.indent + "[" + m11 + " " + m12 + " " + m21 + " " + m22 + " " + dx + " " + dy + "] concat\n";
};

// reset transform matrix to the identity matrix then call transform
EpsContext.prototype.setTransform = function(m11, m12, m21, m22, dx, dy) {
  // command:
  // "[1 0 0 1 0 0] defaultmatrix setmatrix 0 height translate 1 -1 scale "
  // "[M11 M12 M21 M22 DX DY] concat"
  this.eps_text += this.indent + "[1 0 0 1 0 0] defaultmatrix setmatrix\n";
  this.eps_text += this.indent + "0 " + this.height + " translate\n";
  this.eps_text += this.indent + "1 -1 scale\n";
  this.transform(m11, m12, m21, m22, dx, dy);
};

EpsContext.prototype.register_font = function(font_str, eps_font, size) {
  font_str = font_str.replace(/\s+/g, ""); // remove spaces
  font_str = font_str.toLowerCase(); // lower case
  this.font_lookup[font_str] = {'name': eps_font, 'size': size};
};

EpsContext.prototype.lookup_font = function(font_str) {
  font_str = font_str.replace(/\s+/g, ""); // remove spaces
  font_str = font_str.toLowerCase(); // lower case
  return this.font_lookup[font_str];
};

// return the EPS text
EpsContext.prototype.eps = function() {
  return this.eps_text + this.indent + "showpage\n";
};

    </script>
    <script type="text/javascript">
//======================================================================
// start Alphabet object
//======================================================================
var Alphabet = function(alphabet, background) {
  "use strict";
  var i, j, sym, aliases, complement, comp_e_sym, ambigs, generate_background;
  generate_background = (background == null);
  if (generate_background) {
    background = [];
    for (i = 0; i < alphabet.ncore; i++) background[i] = 1.0 / alphabet.ncore;
  } else if (alphabet.ncore != background.length) {
    throw new Error("The background length does not match the alphabet length.");
  }
  this.name = alphabet.name;
  this.like = (alphabet.like != null ? alphabet.like.toUpperCase() : null);
  this.ncore = alphabet.ncore;
  this.symbols = alphabet.symbols;
  this.background = background;
  this.genbg = generate_background;
  this.encode = {};
  this.encode2core = {};
  this.complement = {};
  // check if all symbols are same case
  var seen_uc = false;
  var seen_lc = false;
  var check_case = function (syms) {
    var s, sym;
    if (typeof syms === "string") {
      for (s = 0; s < syms.length; s++) {
        sym = syms.charAt(s);
        if (sym >= 'a' && sym <= 'z') seen_lc = true;
        else if (sym >= 'A' && sym <= 'Z') seen_uc = true;
      }
    }
  };
  for (i = 0; i < this.symbols.length; i++) {
    check_case(this.symbols[i].symbol);
    check_case(this.symbols[i].aliases);
  }
  // now map symbols to indexes
  var update_array = function(array, syms, index) {
    var s, sym;
    if (typeof syms === "string") {
      for (s = 0; s < syms.length; s++) {
        sym = syms.charAt(s);
        array[sym] = index;
        // when only a single case is used, then encode as case insensitive
        if (seen_uc != seen_lc) {
          if (sym >= 'a' && sym <= 'z') {
            array[sym.toUpperCase()] = index;
          } else if (sym >= 'A' && sym <= 'Z') {
            array[sym.toLowerCase()] = index;
          }
        }
      }
    }
  }
  // map core symbols to index
  for (i = 0; i < this.ncore; i++) {
    update_array(this.encode2core, this.symbols[i].symbol, i);
    update_array(this.encode, this.symbols[i].symbol, i);
    update_array(this.encode2core, this.symbols[i].aliases, i);
    update_array(this.encode, this.symbols[i].aliases, i);
  }
  // map ambiguous symbols to index
  ambigs = {};
  for (i = this.ncore; i < this.symbols.length; i++) {
    update_array(this.encode, this.symbols[i].symbol, i);
    update_array(this.encode, this.symbols[i].aliases, i);
    ambigs[this.symbols[i].equals] = i;
  }
  // determine complements
  for (i = 0; i < this.ncore; i++) {
    complement = this.symbols[i].complement;
    if (typeof complement === "string") {
      this.complement[i] = this.encode2core[complement];
    }
  }
  next_symbol:
  for (i = this.ncore; i < this.symbols.length; i++) {
    complement = "";
    for (j = 0; j < this.symbols[i].equals.length; j++) {
      comp_e_sym = this.complement[this.encode2core[this.symbols[i].equals.charAt(j)]];
      if (typeof comp_e_sym !== "number") continue next_symbol;
      complement += this.symbols[comp_e_sym].symbol;
    }
    complement = complement.split("").sort().join("");
    if (typeof ambigs[complement] === "number") {
      this.complement[i] = ambigs[complement];
    }
  }
  // determine case insensitivity
  this.case_insensitive = true;
  if (seen_uc == seen_lc) {
    // when there is a mixture of cases it probably won't
    // be case insensitive but we still need to check
    loop:
    for (i = 0; i < this.symbols.length; i++) {
      sym = this.symbols[i].symbol;
      if (sym >= 'A' && sym <= 'Z') {
        if (this.encode[sym.toLowerCase()] != i) {
          this.case_insensitive = false;
          break loop;
        }
      } else if (sym >= 'a' && sym <= 'z') {
        if (this.encode[sym.toUpperCase()] != i) {
          this.case_insensitive = false;
          break loop;
        }
      }
      aliases = this.symbols[i].aliases;
      if (aliases != null) {
        for (j = 0; j < aliases.length; j++) {
          sym = aliases.charAt(j);
          if (sym >= 'A' && sym <= 'Z') {
            if (this.encode[sym.toLowerCase()] != i) {
              this.case_insensitive = false;
              break loop;
            }
          } else if (sym >= 'a' && sym <= 'z') {
            if (this.encode[sym.toUpperCase()] != i) {
              this.case_insensitive = false;
              break loop;
            }
          }
        }
      }
    }
  }
  // normalise aliases to remove the prime symbol and eliminate
  // the alternate cases when the alphabet is case insensitive
  var seen, out;
  for (i = 0; i < this.symbols.length; i++) {
    sym = this.symbols[i].symbol;
    aliases = this.symbols[i].aliases;
    if (typeof aliases != "string") aliases = "";
    seen = {};
    out = [];
    if (this.case_insensitive) {
      sym = sym.toUpperCase();
      aliases = aliases.toUpperCase();
    }
    seen[sym] = true;
    for (j = 0; j < aliases.length; j++) {
      if (!seen[aliases.charAt(j)]) {
        seen[aliases.charAt(j)] = true;
        out.push(aliases.charAt(j));
      }
    }
    this.symbols[i].aliases = out.sort().join("");
  }
};
// return the name of the alphabet
Alphabet.prototype.get_alphabet_name = function() {
  return this.name;
};
// return if the alphabet can be complemented
Alphabet.prototype.has_complement = function() {
  return (typeof this.symbols[0].complement === "string");
};
// return true if an uppercase letter has the same meaning as the lowercase form
Alphabet.prototype.is_case_insensitive = function() {
  return this.case_insensitive;
};
// return the information content of an alphabet letter
Alphabet.prototype.get_ic = function() {
  return Math.log(this.ncore) / Math.LN2;
};
// return the count of the core alphabet symbols
Alphabet.prototype.get_size_core = function() {
  return this.ncore;
};
// return the count of all alphabet symbols
Alphabet.prototype.get_size_full = function() {
  return this.symbols.length;
};
// return the symbol for the given alphabet index
Alphabet.prototype.get_symbol = function(alph_index) {
  "use strict";
  if (alph_index < 0 || alph_index >= this.symbols.length) {
    throw new Error("Alphabet index out of bounds");
  }
  return this.symbols[alph_index].symbol;
};
// return the aliases for the given alphabet index
Alphabet.prototype.get_aliases = function(alph_index) {
  "use strict";
  if (alph_index < 0 || alph_index >= this.symbols.length) {
    throw new Error("Alphabet index out of bounds");
  }
  var sym_obj = this.symbols[alph_index];
  return (sym_obj.aliases != null ? sym_obj.aliases : "");
};
// return the name for the given alphabet index
Alphabet.prototype.get_name = function(alph_index) {
  "use strict";
  var sym;
  if (alph_index < 0 || alph_index >= this.symbols.length) {
    throw new Error("Alphabet index out of bounds");
  }
  sym = this.symbols[alph_index];
  return (typeof sym.name === "string" ? sym.name : sym.symbol);
};
// return the alphabet it is like or null
Alphabet.prototype.get_like = function() {
  "use strict";
  return this.like;
};
// return the index of the complement for the given alphabet index
Alphabet.prototype.get_complement = function(alph_index) {
  var comp_e_sym = this.complement[alph_index];
  if (typeof comp_e_sym === "number") {
    return comp_e_sym;
  } else {
    return -1;
  }
};
// return a string containing the core symbols
Alphabet.prototype.get_symbols = function() {
  "use strict";
  var i, core_symbols;
  core_symbols = "";
  for (i = 0; i < this.ncore; i++) {
    core_symbols += this.symbols[i].symbol;
  }
  return core_symbols;
};
// return if the background was not a uniform generated background
Alphabet.prototype.has_bg = function() {
  "use strict";
  return !this.genbg;
};
// get the background frequency for the index
Alphabet.prototype.get_bg_freq = function(alph_index) {
  "use strict";
  var freq, i, symbols;
  if (alph_index >= 0) {
    if (alph_index < this.ncore) {
      return this.background[alph_index];
    } else if (alph_index < this.symbols.length) {
      freq = 0;
      symbols = this.symbols[alph_index].equals;
      for (i = 0; i < symbols.length; i++) {
        freq += this.background[this.encode2core[symbols.charAt(i)]];
      }
      return freq;
    } 
  }
  throw new Error("The alphabet index is out of range.");
};
// get the colour of the index
Alphabet.prototype.get_colour = function(alph_index) {
  "use strict";
  if (alph_index < 0 || alph_index >= this.symbols.length) {
    throw new Error("BAD_ALPHABET_INDEX");
  }
  if (typeof this.symbols[alph_index].colour != "string") {
    return "black";
  }
  return "#" + this.symbols[alph_index].colour;
};
// get the rgb components of the colour at the index
Alphabet.prototype.get_rgb = function(alph_index) {
  "use strict";
  if (alph_index < 0 || alph_index >= this.symbols.length) {
    throw new Error("BAD_ALPHABET_INDEX");
  }
  if (typeof this.symbols[alph_index].colour != "string") {
    return {"red": 0, "green": 0, "blue": 0};
  }
  var colour = this.symbols[alph_index].colour;
  var red = parseInt(colour.substr(0, 2), 16) / 255;
  var green = parseInt(colour.substr(2, 2), 16) / 255;
  var blue = parseInt(colour.substr(4, 2), 16) / 255;
  return {"red": red, "green": green, "blue": blue};
};
// convert a symbol into the index
Alphabet.prototype.get_index = function(letter) {
  "use strict";
  var alph_index;
  alph_index = this.encode[letter];
  if (typeof alph_index === "undefined") {
    return -1;
  }
  return alph_index;
};
// convert a symbol into the list of core indexes that it equals
Alphabet.prototype.get_indexes = function(letter) {
  "use strict";
  var alph_index, comprise_str, i, comprise_list;
  alph_index = this.encode[letter];
  if (typeof alph_index === "undefined") {
    throw new Error("Unknown letter");
  }
  comprise_str = this.symbols[alph_index].equals;
  comprise_list = [];
  if (typeof comprise_str == "string") {
    for (i = 0; i < comprise_str.length; i++) {
      comprise_list.push(this.encode2core[comprise_str.charAt(i)]);
    }
  } else {
    comprise_list.push(alph_index);
  }
  return comprise_list;
};
// check if a symbol is the primary way of representing the symbol in the alphabet
Alphabet.prototype.is_prime_symbol = function(letter) {
  var alph_index;
  alph_index = this.encode[letter];
  if (alph_index == null) return false;
  if (this.is_case_insensitive()) {
    return (this.symbols[alph_index].symbol.toUpperCase() == letter.toUpperCase());
  } else {
    return (this.symbols[alph_index].symbol == letter);
  }
};
// compare 2 alphabets
Alphabet.prototype.equals = function(other) {
  "use strict";
  var i, sym1, sym2;
  // first check that it's actually an alphabet object
  if (!(typeof other === "object" && other != null && other instanceof Alphabet)) {
    return false;
  }
  // second shortcircuit if it's the same object
  if (this === other) return true;
  // compare
  if (this.name !== other.name) return false;
  if (this.ncore !== other.ncore) return false;
  if (this.symbols.length !== other.symbols.length) return false;
  for (i = 0; i < this.symbols.length; i++) {
    sym1 = this.symbols[i];
    sym2 = other.symbols[i];
    if (sym1.symbol !== sym2.symbol) return false;
    if (sym1.aliases !== sym2.aliases) return false;
    if (sym1.name !== sym2.name) return false;
    if (typeof sym1.colour !== typeof sym2.colour || 
        (typeof sym1.colour === "string" && typeof sym2.colour === "string" &&
         parseInt(sym1.colour, 16) != parseInt(sym2.colour, 16))) {
      return false;
    }
    if (sym1.complement !== sym2.complement) return false;
    if (sym1.equals !== sym2.equals) return false;
  }
  return true;
};
Alphabet.prototype.check_core_subset = function(super_alph) {
  var complement_same = true;
  var seen_set = {};
  var sub_i, sub_symbol, super_i, super_symbol;
  for (sub_i = 0; sub_i < this.ncore; sub_i++) {
    sub_symbol = this.symbols[sub_i];
    super_i = super_alph.encode[sub_symbol.symbol]; 
    if (super_i == null) return 0;
    super_symbol = super_alph.symbols[super_i];
    if (seen_set[super_i]) return 0;
    seen_set[super_i] = true;
    // check complement
    if (sub_symbol.complement != null && super_symbol.complement != null) {
      if (super_alph.encode[sub_symbol.complement] != super_alph.encode[super_symbol.complement]) {
        complement_same = false;
      }
    } else if (sub_symbol.complement != null || super_symbol.complement != null) {
      complement_same = false;
    }
  }
  return (complement_same ? 1 : -1);
};
// convert a sequence to its reverse complement
Alphabet.prototype.invcomp_seq = function(seq) {
  "use strict";
  var syms, i, e_sym, comp_e_sym;
  if (!this.has_complement()) throw new Error("Alphabet must be complementable");
  syms = seq.split("");
  for (i = 0; i < syms.length; i++) {
    e_sym = this.encode[syms[i]];
    if (typeof e_sym === "undefined") {
      e_sym = this.ncore; // wildcard
    }
    comp_e_sym = this.complement[e_sym];
    if (typeof comp_e_sym === "undefined") {
      comp_e_sym = e_sym; // not complementable
    }
    syms[i] = this.symbols[comp_e_sym].symbol;
  }
  return syms.reverse().join("");
};
// convert the alphabet to the text version
Alphabet.prototype.as_text = function() {
  "use strict";
  function name_as_text(name) {
    var i, c, out;
    out = "\"";
    for (i = 0; i < name.length; i++) {
      c = name.charAt(i);
      if (c == "\"") {
        out += "\\\"";
      } else if (c == "/") {
        out += "\\/";
      } else if (c == "\\") {
        out += "\\\\";
      } else {
        out += c;
      }
    }
    out += "\"";
    return out;
  }
  function symbol_as_text(sym) {
    var out;
    out = sym.symbol;
    if (typeof sym.name === "string" && sym.name != sym.symbol) {
      out += " " + name_as_text(sym.name);
    }
    if (typeof sym.colour === "string") {
      out += " " + sym.colour;
    }
    return out;
  }
  var out, i, j, c, sym;
  out = "";
  // output core symbols with 2 way complements
  for (i = 0; i < this.ncore; i++) {
    c = this.complement[i];
    if (typeof c === "number" && i < c && this.complement[c] === i) {
      out += symbol_as_text(this.symbols[i]) + " ~ " + symbol_as_text(this.symbols[c]) + "\n";  
    }
  }
  // output core symbols with no complement
  for (i = 0; i < this.ncore; i++) {
    if (typeof this.complement[i] === "undefined") {
      out += symbol_as_text(this.symbols[i]) + "\n";
    }
  }
  // output ambiguous symbols that have comprising characters
  for (i = this.ncore; i < this.symbols.length; i++) {
    if (this.symbols[i].equals.length == 0) break;
    out += symbol_as_text(this.symbols[i]) + " = " + this.symbols[i].equals + "\n";
    if (typeof this.symbols[i].aliases === "string") {
      for (j = 0; j < this.symbols[i].aliases.length; j++) {
        if (this.symbols[i].aliases.charAt(j) == this.symbols[i].symbol) continue;
        out += this.symbols[i].aliases.charAt(j) + " = " + this.symbols[i].equals + "\n";
      }
    }
  }
  // output aliases of core symbols
  for (i = 0; i < this.ncore; i++) {
    if (typeof this.symbols[i].aliases === "string") {
      for (j = 0; j < this.symbols[i].aliases.length; j++) {
        if (this.symbols[i].aliases.charAt(j) == this.symbols[i].symbol) continue;
        out += this.symbols[i].aliases.charAt(j) + " = " + this.symbols[i].symbol + "\n";
      }
    }
  }
  // output gap symbols
  i = this.symbols.length - 1;
  if (this.symbols[i].equals.length == 0) {
    out += symbol_as_text(this.symbols[i]) + " =\n";
    if (typeof this.symbols[i].aliases === "string") {
      for (j = 0; j < this.symbols[i].aliases.length; j++) {
        if (this.symbols[i].aliases.charAt(j) == this.symbols[i].symbol) continue;
        out += this.symbols[i].aliases.charAt(j) + " =\n";
      }
    }
  }
  return out;
};
// output the alphabet as it appears in minimal MEME format
Alphabet.prototype.as_meme = function() {
  "use strict";
  function name_as_text(name) {
    var i, c, out;
    out = "\"";
    for (i = 0; i < name.length; i++) {
      c = name.charAt(i);
      if (c == "\"") {
        out += "\\\"";
      } else if (c == "/") {
        out += "\\/";
      } else if (c == "\\") {
        out += "\\\\";
      } else {
        out += c;
      }
    }
    out += "\"";
    return out;
  }
  if (this.equals(AlphStd.DNA)) {
    return "ALPHABET= ACGT\n";
  } else if (this.equals(AlphStd.PROTEIN)) {
    return "ALPHABET= ACDEFGHIKLMNPQRSTVWY\n";
  } else {
    return "ALPHABET" + 
      (this.name != null ? " " + name_as_text(this.name) : "") + 
      (this.like != null ? " " + this.like + "-LIKE" : "") + "\n" +
      this.as_text() + "END ALPHABET\n";
  }
};

// Returns a table showing all the letters in the alphabet
Alphabet.prototype.as_table = function() {
  "use strict";
  var i, j, row, th, td, aliases, equals, sym;
  var table = document.createElement("table");
  // create the core symbol header
  row = table.insertRow(table.rows.length);
  th = document.createElement("th");
  th.appendChild(document.createTextNode("Symbol(s)"));
  row.appendChild(th);
  th = document.createElement("th");
  th.appendChild(document.createTextNode("Name"));
  row.appendChild(th);
  th = document.createElement("th");
  if (this.has_complement()) {
    th.appendChild(document.createTextNode("Complement"));
  }
  row.appendChild(th);
  // list the core symbols
  for (i = 0; i < this.ncore; i++) {
    row = table.insertRow(table.rows.length);
    td = document.createElement("td");
    if (this.symbols[i].colour != null) {
      td.style.color = '#' + this.symbols[i].colour;
    }
    td.appendChild(document.createTextNode(this.symbols[i].symbol));
    aliases = this.get_aliases(i);
    if (aliases.length > 0) {
      td.appendChild(document.createTextNode(' ' + aliases.split('').join(' ')));
    }
    row.appendChild(td);
    td = document.createElement("td");
    if (this.symbols[i].name != null) {
      td.appendChild(document.createTextNode(this.symbols[i].name));
    }
    row.appendChild(td);
    td = document.createElement("td");
    if (this.symbols[i].complement != null) {
      td.style.color = this.get_colour(this.get_index(this.symbols[i].complement));
      td.appendChild(document.createTextNode(this.symbols[i].complement));
    }
    row.appendChild(td);
  }
  // create the ambiguous symbol header
  row = table.insertRow(table.rows.length);
  th = document.createElement("th");
  th.appendChild(document.createTextNode("Symbol(s)"));
  row.appendChild(th);
  th = document.createElement("th");
  th.appendChild(document.createTextNode("Name"));
  row.appendChild(th);
  th = document.createElement("th");
  th.appendChild(document.createTextNode("Matches"));
  row.appendChild(th);
  // list the ambiguous symbols
  for (i = this.ncore; i < this.symbols.length; i++) {
    row = table.insertRow(table.rows.length);
    td = document.createElement("td");
    if (this.symbols[i].colour != null) {
      td.style.color = '#' + this.symbols[i].colour;
    }
    td.appendChild(document.createTextNode(this.symbols[i].symbol));
    aliases = this.get_aliases(i);
    if (aliases.length > 0) {
      td.appendChild(document.createTextNode(' ' + aliases.split('').join(' ')));
    }
    row.appendChild(td);
    td = document.createElement("td");
    if (this.symbols[i].name != null) {
      td.appendChild(document.createTextNode(this.symbols[i].name));
    }
    row.appendChild(td);
    td = document.createElement("td");
    equals = this.symbols[i].equals.split('');
    for (j = 0; j < equals.length; j++) {
      if (j != 0) td.appendChild(document.createTextNode(' '));
      sym = document.createElement("span");
      sym.style.color = this.get_colour(this.get_index(equals[j]));
      sym.appendChild(document.createTextNode(equals[j]));
      td.appendChild(sym);
    }
    row.appendChild(td);
  }
  return table;
};

// returns a dictionary of the colours for EPS
Alphabet.prototype._as_eps_dict = function() {
  "use strict";
  var i, sym, rgb;
  var out = "/fullColourDict <<\n";
  for (i = 0; i < this.ncore; i++) {
    sym = this.get_symbol(i);
    sym = sym.replace(/\\/g, "\\\\");
    sym = sym.replace(/\(/g, "\\(");
    sym = sym.replace(/\)/g, "\\)");
    rgb = this.get_rgb(i);
    out += " (" + sym + ") [" + rgb.red.toFixed(4) + " " + rgb.green.toFixed(4) + " " + rgb.blue.toFixed(4) + "]\n";
  }
  out += ">> def\n";
  out += "/mutedColourDict <<\n";
  for (i = 0; i < this.ncore; i++) {
    sym = this.get_symbol(i);
    sym = sym.replace(/\\/g, "\\\\");
    sym = sym.replace(/\(/g, "\\(");
    sym = sym.replace(/\)/g, "\\)");
    rgb = Alphabet.lighten_colour(this.get_rgb(i));
    out += " (" + sym + ") [" + rgb.red.toFixed(4) + " " + rgb.green.toFixed(4) + " " + rgb.blue.toFixed(4) + "]\n";
  }
  out += ">> def\n";
  return out;
};

// return the alphabet name or a list of primary symbols
Alphabet.prototype.toString = function() {
  "use strict";
  if (this.name != null) {
    return this.name;
  } else {
    return this.get_symbols();
  }
};

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Helper functions
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// Convert a colour specified in RGB colourspace values into LAB colourspace
Alphabet.rgb2lab = function(rgb) {
  "use strict";
  var xyzHelper, labHelper;
  // XYZ helper
  xyzHelper = function(value) {
    if (value > 0.0445) {
      value = (value + 0.055) / 1.055;
      value = Math.pow(value, 2.4);
    } else {
      value /= 12.92;
    }
    value *= 100;
    return value;
  };
  // lab helper
  labHelper = function(value) {
    if (value > 0.008856) {
      value = Math.pow(value, 1.0 / 3.0);
    } else {
      value = (7.787 * value) + (16.0 / 116.0);
    }
    return value;
  };
  // convert into XYZ colourspace
  var c1, c2, c3;
  if (typeof rgb == "number") {
    c1 = xyzHelper(((rgb >> 16) & 0xFF) / 255.0);
    c2 = xyzHelper(((rgb >> 8) & 0xFF) / 255.0);
    c3 = xyzHelper((rgb & 0xFF) / 255.0);
  } else {
    c1 = xyzHelper(rgb.red);
    c2 = xyzHelper(rgb.green);
    c3 = xyzHelper(rgb.blue);
  }
  var x = (c1 * 0.4124) + (c2 * 0.3576) + (c3 * 0.1805);
  var y = (c1 * 0.2126) + (c2 * 0.7152) + (c3 * 0.0722);
  var z = (c1 * 0.0193) + (c2 * 0.1192) + (c3 * 0.9505);
  // convert into Lab colourspace
  c1 = labHelper(x / 95.047);
  c2 = labHelper(y / 100.0);
  c3 = labHelper(z / 108.883);
  var l = (116.0 * c2) - 16;
  var a = 500.0 * (c1 - c2);
  var b = 200.0 * (c2 - c3);
  return {"l": l, "a": a, "b": b};
};

// Convert a colour specified in HSV colourspace into RGB colourspace
Alphabet.hsv2rgb = function(hue, sat, value, output_object) {
  // achromatic (grey)
  var r = value;
  var g = value;
  var b = value;
  if (sat != 0) {
    var h = hue / 60.0;
    var i = Math.floor(h);
    var f = h - i;
    var p = value * (1.0 - sat);
    var q = value * (1.0 - (sat * f));
    var t = value * (1.0 - (sat * (1.0 - f)));
    if (i == 0) {
      r = value;
      g = t;
      b = p;
    } else if (i == 1) {
      r = q;
      g = value;
      b = p;
    } else if (i == 2) {
      r = p;
      g = value;
      b = t;
    } else if (i == 3) {
      r = p;
      g = q;
      b = value;
    } else if (i == 4) {
      r = t;
      g = p;
      b = value;
    } else {
      r = value;
      g = p;
      b = q;
    }
  }
  if (output_object) {
    return {"red": r, "green": g, "blue": b};
  } else {
    return (Math.floor(r * 255) << 15) | (Math.floor(g * 255) << 8) | (Math.floor(b * 255));
  }
};

// Calculate a distance score between two colours in LAB colourspace
Alphabet.lab_dist = function(lab1, lab2) {
  var c1 = Math.sqrt((lab1.l * lab1.l) + (lab1.a * lab1.a));
  var c2 = Math.sqrt((lab2.l * lab2.l) + (lab2.a * lab2.a));
  var dc = c1 - c2;
  var dl = lab1.l - lab2.l;
  var da = lab1.a - lab2.a;
  var db = lab1.b - lab2.b;
  // we don't want NaN due to rounding errors so fudge things a bit...
  var dh = 0;
  var dh_squared = (da * da) + (db * db) - (dc * dc);
  if (dh_squared > 0) {
    dh = Math.sqrt(dh_squared);
  }
  var first = dl;
  var second = dc / (1.0 + (0.045 * c1));
  var third = dh / (1.0 + (0.015 * c1));
  return Math.sqrt((first * first) + (second * second) + (third * third));
};

// convert an RGB value into a HSL value
Alphabet.rgb2hsl = function(rgb) {
  "use strict";
  var min, max, delta, h, s, l, r, g, b;
  if (typeof rgb == "number") {
    r = ((rgb >> 16) & 0xFF) / 255.0;
    g = ((rgb >> 8) & 0xFF) / 255.0;
    b = (rgb & 0xFF) / 255.0;
  } else {
    r = rgb.red;
    g = rgb.green;
    b = rgb.blue;
  }
  min = Math.min(r, g, b);
  max = Math.max(r, g, b);
  delta = max - min;
  l = min + (delta / 2);
  if (max == min) {
    h = 0; // achromatic (grayscale)
    s = 0;
  } else {
    if (l > 0.5) {
      s = delta / (2 - max - min);
    } else {
      s = delta / (max + min);
    }
    if (max == r) {
      h = (g - b) / delta;
      if (g < b) h += 6;
    } else if (max == g) {
      h = ((b - r) / delta) + 2;
    } else {
      h = ((r - g) / delta) + 4;
    }
    h /= 6;
  }
  return {"h": h, "s": s, "l": l};
};

// convert a HSL value into an RGB value
Alphabet.hsl2rgb = function(hsl, output_object) {
  "use strict";
  function _hue(p, q, t) {
    "use strict";
    if (t < 0) t += 1;
    else if (t > 1) t -= 1;
    if (t < (1.0 / 6.0)) {
      return p + ((q - p) * 6.0 * t);
    } else if (t < 0.5) {
      return q;
    } else if (t < (2.0 / 3.0)) {
      return p + ((q - p) * ((2.0 / 3.0) - t) * 6.0);
    } else {
      return p;
    }
  }
  var r, g, b, p, q;
  if (hsl.s == 0) {
    // achromatic (grayscale)
    r = hsl.l;
    g = hsl.l;
    b = hsl.l;
  } else {
    if (hsl.l < 0.5) {
      q = hsl.l * (1 + hsl.s);
    } else {
      q = hsl.l + hsl.s - (hsl.l * hsl.s);
    }
    p = (2 * hsl.l) - q;
    r = _hue(p, q, hsl.h + (1.0 / 3.0));
    g = _hue(p, q, hsl.h);
    b = _hue(p, q, hsl.h - (1.0 / 3.0));
  }
  if (output_object) {
    return {"red": r, "green": g, "blue": b};
  } else {
    return (Math.floor(r * 255) << 15) | (Math.floor(g * 255) << 8) | (Math.floor(b * 255));
  }
};

Alphabet.lighten_colour = function(rgb) {
  "use strict";
  var hsl = Alphabet.rgb2hsl(rgb);
  hsl.l += (1.0 - hsl.l) * 2 / 3;
  return Alphabet.hsl2rgb(hsl, typeof rgb != "number");
};

//======================================================================
// end Alphabet object
//======================================================================

//======================================================================
// start StandardAlphabet object
//======================================================================

// an extension of the alphabet object to support some additional fields 
// only present in standard alphabets.
var StandardAlphabet = function(enum_code, enum_name, alphabet_data) {
  Alphabet.apply(this, [alphabet_data]);
  this.enum_code = enum_code;
  this.enum_name = enum_name;
};
StandardAlphabet.prototype = Alphabet.prototype;
StandardAlphabet.prototype.constructor = StandardAlphabet;

// A unique code for this standard alphabet.
// This code will be a power of 2 to enable creation of bitsets for
// a selection of standard alphabets.
StandardAlphabet.prototype.get_code = function() {
  return this.enum_code;
};

// A unique name for this standard alphabet.
// this name will be all upper case and the same as the property that
// refers to this alphabet in the AlphStd collection.
StandardAlphabet.prototype.get_enum = function() {
  return this.enum_name;
};

//======================================================================
// end StandardAlphabet object
//======================================================================

// A collection of standard alphabets.
var AlphStd = {
  RNA: new StandardAlphabet(1, "RNA", {
    "name": "RNA",
    "like": "RNA",
    "ncore": 4,
    "symbols": [
      {"symbol": "A", "name": "Adenine", "colour": "CC0000"},
      {"symbol": "C", "name": "Cytosine", "colour": "0000CC"},
      {"symbol": "G", "name": "Guanine", "colour": "FFB300"},
      {"symbol": "U", "name": "Uracil", "colour": "008000",
        "aliases": "T"},
      {"symbol": "N", "name": "Any base", "equals": "ACGU", "aliases": "X."},
      {"symbol": "V", "name": "Not U", "equals": "ACG"},
      {"symbol": "H", "name": "Not G", "equals": "ACU"},
      {"symbol": "D", "name": "Not C", "equals": "AGU"},
      {"symbol": "B", "name": "Not A", "equals": "CGU"},
      {"symbol": "M", "name": "Amino", "equals": "AC"},
      {"symbol": "R", "name": "Purine", "equals": "AG"},
      {"symbol": "W", "name": "Weak", "equals": "AU"}, 
      {"symbol": "S", "name": "Strong", "equals": "CG"},
      {"symbol": "Y", "name": "Pyrimidine", "equals": "CU"},
      {"symbol": "K", "name": "Keto", "equals": "GU"}
    ]
  }), 
  DNA: new StandardAlphabet(2, "DNA", {
    "name": "DNA",
    "like": "DNA",
    "ncore": 4,
    "symbols": [
      {"symbol": "A", "name": "Adenine", "colour": "CC0000", "complement": "T"},
      {"symbol": "C", "name": "Cytosine", "colour": "0000CC", "complement": "G"},
      {"symbol": "G", "name": "Guanine", "colour": "FFB300", "complement": "C"},
      {"symbol": "T", "name": "Thymine", "colour": "008000", "complement": "A",
        "aliases": "U"},
      {"symbol": "N", "name": "Any base", "equals": "ACGT", "aliases": "X."},
      {"symbol": "V", "name": "Not T", "equals": "ACG"},
      {"symbol": "H", "name": "Not G", "equals": "ACT"},
      {"symbol": "D", "name": "Not C", "equals": "AGT"},
      {"symbol": "B", "name": "Not A", "equals": "CGT"},
      {"symbol": "M", "name": "Amino", "equals": "AC"},
      {"symbol": "R", "name": "Purine", "equals": "AG"},
      {"symbol": "W", "name": "Weak", "equals": "AT"}, 
      {"symbol": "S", "name": "Strong", "equals": "CG"},
      {"symbol": "Y", "name": "Pyrimidine", "equals": "CT"},
      {"symbol": "K", "name": "Keto", "equals": "GT"}
    ]
  }), 
  PROTEIN: new StandardAlphabet(4, "PROTEIN", {
    "name": "Protein",
    "like": "PROTEIN",
    "ncore": 20,
    "symbols": [
      {"symbol": "A", "name": "Alanine", "colour": "0000CC"},
      {"symbol": "C", "name": "Cysteine", "colour": "0000CC"},
      {"symbol": "D", "name": "Aspartic acid", "colour": "FF00FF"},
      {"symbol": "E", "name": "Glutamic acid", "colour": "FF00FF"},
      {"symbol": "F", "name": "Phenylalanine", "colour": "0000CC"},
      {"symbol": "G", "name": "Glycine", "colour": "FFB300"},
      {"symbol": "H", "name": "Histidine", "colour": "FFCCCC"},
      {"symbol": "I", "name": "Isoleucine", "colour": "0000CC"},
      {"symbol": "K", "name": "Lysine", "colour": "CC0000"},
      {"symbol": "L", "name": "Leucine", "colour": "0000CC"},
      {"symbol": "M", "name": "Methionine", "colour": "0000CC"},
      {"symbol": "N", "name": "Asparagine", "colour": "008000"},
      {"symbol": "P", "name": "Proline", "colour": "FFFF00"},
      {"symbol": "Q", "name": "Glutamine", "colour": "008000"},
      {"symbol": "R", "name": "Arginine", "colour": "CC0000"},
      {"symbol": "S", "name": "Serine", "colour": "008000"},
      {"symbol": "T", "name": "Threonine", "colour": "008000"},
      {"symbol": "V", "name": "Valine", "colour": "0000CC"},
      {"symbol": "W", "name": "Tryptophan", "colour": "0000CC"},
      {"symbol": "Y", "name": "Tyrosine", "colour": "33E6CC"},
      {"symbol": "X", "name": "Any amino acid", "equals": "ACDEFGHIKLMNPQRSTVWY", "aliases": "*."},
      {"symbol": "B", "name": "Asparagine or Aspartic acid", "equals": "DN"}, 
      {"symbol": "Z", "name": "Glutamine or Glutamic acid", "equals": "EQ"}, 
      {"symbol": "J", "name": "Leucine or Isoleucine", "equals": "IL"}
    ]
  })
};

//======================================================================
// start Symbol object
//======================================================================
var Symbol = function(alph_index, scale, alphabet) {
  "use strict";
  //variable prototype
  this.symbol = alphabet.get_symbol(alph_index);
  this.scale = scale;
  this.colour = alphabet.get_colour(alph_index);
};

Symbol.prototype.get_symbol = function() {
  "use strict";
  return this.symbol;
};

Symbol.prototype.get_scale = function() {
  "use strict";
  return this.scale;
};

Symbol.prototype.get_colour = function() {
  "use strict";
  return this.colour;
};

Symbol.prototype.toString = function() {
  "use strict";
  return this.symbol + " " + (Math.round(this.scale*1000)/10) + "%";
};

function compare_symbol(sym1, sym2) {
  "use strict";
  if (sym1.get_scale() < sym2.get_scale()) {
    return -1;
  } else if (sym1.get_scale() > sym2.get_scale()) {
    return 1;
  } else {
    return 0;
  }
}
//======================================================================
// end Symbol object
//======================================================================

//======================================================================
// start Pspm object
//======================================================================
var Pspm = function(matrix, name, ltrim, rtrim, nsites, evalue, pssm, alt) {
  "use strict";
  var row, col, data, row_sum, delta, evalue_re;
  if (typeof name !== "string") {
    name = "";
  }
  this.name = name;
  //construct
  if (matrix instanceof Pspm) {
    // copy constructor
    this.alph_length = matrix.alph_length;
    this.motif_length = matrix.motif_length;
    this.name = matrix.name;
    this.alt = matrix.alt;
    this.nsites = matrix.nsites;
    this.evalue = matrix.evalue;
    this.ltrim = matrix.ltrim;
    this.rtrim = matrix.rtrim;
    this.pspm = [];
    for (row = 0; row < matrix.motif_length; row++) {
      this.pspm[row] = [];
      for (col = 0; col < matrix.alph_length; col++) {
        this.pspm[row][col] = matrix.pspm[row][col];
      }
    }
    if (matrix.pssm != null) {
      this.pssm = [];
      for (row = 0; row < matrix.motif_length; row++) {
        this.pspm[row] = [];
        for (col = 0; col < matrix.alph_length; col++) {
          this.pssm[row][col] = matrix.pssm[row][col];
        }
      }
    }
  } else {
    // check parameters
    if (ltrim == null) {
      ltrim = 0;
    } else if (typeof ltrim !== "number" || ltrim % 1 !== 0 || ltrim < 0) {
      throw new Error("ltrim must be a non-negative integer, got: " + ltrim);
    }
    if (rtrim == null) {
      rtrim = 0;
    } else if (typeof rtrim !== "number" || rtrim % 1 !== 0 || rtrim < 0) {
      throw new Error("rtrim must be a non-negative integer, got: " + rtrim);
    }
    if (nsites != null) {
      if (typeof nsites !== "number" || nsites < 0) {
        throw new Error("nsites must be a positive number, got: " + nsites);
      } else if (nsites == 0) {
        nsites = null;
      }
    }
    if (evalue != null) {
      if (typeof evalue === "number") {
        if (evalue < 0) {
          throw new Error("evalue must be a non-negative number, got: " + evalue);
        }
      } else if (typeof evalue === "string") {
        evalue_re = /^((?:[+]?[0-9]*\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|inf)$/;
        if (!evalue_re.test(evalue)) {
          throw new Error("evalue must be a non-negative number, got: " + evalue);
        }
      } else {
        throw new Error("evalue must be a non-negative number, got: " + evalue);
      }
    }
    // set properties
    this.name = name;
    this.alt = alt;
    this.nsites = nsites;
    this.evalue = evalue;
    this.ltrim = ltrim;
    this.rtrim = rtrim;
    if (typeof matrix === "string") {
      // string constructor
      data = parse_pspm_string(matrix);
      this.alph_length = data["alph_length"];
      this.motif_length = data["motif_length"];
      this.pspm = data["pspm"];
      if (this.evalue == null) {
        if (data["evalue"] != null) {
          this.evalue = data["evalue"];
        } else {
          this.evalue = 0;
        }
      }
      if (this.nsites == null) {
        if (typeof data["nsites"] === "number") {
          this.nsites = data["nsites"];
        } else {
          this.nsites = 20;
        }
      }
    } else {
      // assume pspm is a nested array
      this.motif_length = matrix.length;
      this.alph_length = (matrix.length > 0 ? matrix[0].length : 0);
      if (this.nsites == null) {
        this.nsites = 20;
      }
      if (this.evalue == null) {
        this.evalue = 0;
      }
      this.pspm = [];
      // copy pspm and check
      for (row = 0; row < this.motif_length; row++) {
        if (this.alph_length != matrix[row].length) {
          throw new Error("COLUMN_MISMATCH");
        }
        this.pspm[row] = [];
        row_sum = 0;
        for (col = 0; col < this.alph_length; col++) {
          this.pspm[row][col] = matrix[row][col];
          row_sum += this.pspm[row][col];
        }
        delta = 0.1;
        if (isNaN(row_sum) || (row_sum > 1 && (row_sum - 1) > delta) || 
            (row_sum < 1 && (1 - row_sum) > delta)) {
          throw new Error("INVALID_SUM");
        }
      }
      // copy pssm
      if (pssm != null) {
        this.pssm = [];
        for (row = 0; row < this.motif_length; row++) {
          this.pssm[row] = [];
          for (col = 0; col < this.alph_length; col++) {
            this.pssm[row][col] = pssm[row][col];
          }
        }
      }
    }
  }
};

Pspm.prototype.copy = function() {
  "use strict";
  return new Pspm(this);
};

Pspm.prototype.reverse = function() {
  "use strict";
  var x, y, temp, temp_trim;
  //reverse
  x = 0;
  y = this.motif_length-1;
  while (x < y) {
    temp = this.pspm[x];
    this.pspm[x] = this.pspm[y];
    this.pspm[y] = temp;
    x++;
    y--;
  }
  // reverse pssm (if defined)
  if (typeof this.pssm !== "undefined") {
    //reverse
    x = 0;
    y = this.motif_length-1;
    while (x < y) {
      temp = this.pssm[x];
      this.pspm[x] = this.pssm[y];
      this.pssm[y] = temp;
      x++;
      y--;
    }
  }
  //swap triming
  temp_trim = this.ltrim;
  this.ltrim = this.rtrim;
  this.rtrim = temp_trim;
  return this; //allow function chaining...
};

Pspm.prototype.reverse_complement = function(alphabet) {
  "use strict";
  var x, y, temp, i, row, c, temp_trim;
  if (this.alph_length != alphabet.get_size_core()) {
    throw new Error("The alphabet size does not match the size of the pspm.");
  }
  if (!alphabet.has_complement()) {
    throw new Error("The specified alphabet can not be complemented.");
  }
  // reverse motif
  this.reverse();
  //complement
  for (x = 0; x < this.motif_length; x++) {
    row = this.pspm[x];
    for (i = 0; i < row.length; i++) {
      c = alphabet.get_complement(i);
      if (c < i) continue;
      temp = row[i];
      row[i] = row[c];
      row[c] = temp;
    }
  }
  // complement pssm (if defined)
  if (typeof this.pssm !== "undefined") {
    //complement
    for (x = 0; x < this.motif_length; x++) {
      row = this.pssm[x];
      for (i = 0; i < row.length; i++) {
        c = alphabet.get_complement(i);
        if (c < i) continue;
        temp = row[i];
        row[i] = row[c];
        row[c] = temp;
      }
    }
  }
  return this; //allow function chaining...
};

Pspm.prototype.get_stack = function(position, alphabet, ssc) {
  "use strict";
  var row, stack_ic, alphabet_ic, stack, i, sym;
  if (this.alph_length != alphabet.get_size_core()) {
    throw new Error("The alphabet size does not match the size of the pspm.");
  }
  row = this.pspm[position];
  stack_ic = this.get_stack_ic(position, alphabet);
  if (ssc) stack_ic -= this.get_error(alphabet);
  alphabet_ic = alphabet.get_ic();
  stack = [];
  for (i = 0; i < this.alph_length; i++) {
    sym = new Symbol(i, row[i]*stack_ic/alphabet_ic, alphabet);
    if (sym.get_scale() <= 0) {
      continue;
    }
    stack.push(sym);
  }
  stack.sort(compare_symbol);
  return stack;
};

Pspm.prototype.get_stack_ic = function(position, alphabet) {
  "use strict";
  var row, H, i;
  if (this.alph_length != alphabet.get_size_core()) {
    throw new Error("The alphabet size does not match the size fo the pspm.");
  }
  row = this.pspm[position];
  H = 0;
  for (i = 0; i < this.alph_length; i++) {
    if (row[i] === 0) {
      continue;
    }
    H -= (row[i] * (Math.log(row[i]) / Math.LN2));
  }
  return alphabet.get_ic() - H;
};

Pspm.prototype.get_error = function(alphabet) {
  "use strict";
  if (this.nsites === 0) {
    return 0;
  }
  return (alphabet.get_size_core()-1) / (2 * Math.LN2 * this.nsites);
};

Pspm.prototype.get_motif_length = function() {
  "use strict";
  return this.motif_length;
};

Pspm.prototype.get_alph_length = function() {
  "use strict";
  return this.alph_length;
};

Pspm.prototype.get_left_trim = function() {
  "use strict";
  return this.ltrim;
};

Pspm.prototype.get_right_trim = function() {
  "use strict";
  return this.rtrim;
};

Pspm.prototype.as_best_match = function(alphabet) {
  "use strict";
  var match, odds, best_odds, best_index;
  var i, j;
  match = "";
  for (i = 0; i < this.motif_length; i++) {
    best_index = 0;
    best_odds = this.pspm[i][0] / alphabet.get_bg_freq(0);
    for (j = 1; j < this.alph_length; j++) {
      odds = this.pspm[i][j] / alphabet.get_bg_freq(j);
      if (odds > best_odds) {
        best_odds = odds;
        best_index = j;
      }
    }
    match += alphabet.get_symbol(best_index);
  }
  return match;
};

Pspm.prototype.as_count_matrix = function() {
  "use strict";
  var count, count_text, text;
  var i, j;
  text = "";
  for (i = 0; i < this.motif_length; i++) {
    if (i !== 0) {
      text += "\n";
    }
    for (j = 0; j < this.alph_length; j++) {
      if (j !== 0) {
        text += " ";
      }
      count = Math.round(this.nsites * this.pspm[i][j]);
      count_text = "" + count;
      // pad up to length of 4
      if (count_text.length < 4) {
        text += (new Array(5 - count_text.length)).join(" ") + count_text;
      } else {
        text += count_text;
      }
    }
  }
  return text; 
};

Pspm.prototype.as_probability_matrix = function() {
  "use strict";
  var text;
  var i, j;
  text = "";
  for (i = 0; i < this.motif_length; i++) {
    if (i !== 0) {
      text += "\n";
    }
    for (j = 0; j < this.alph_length; j++) {
      if (j !== 0) {
        text += " ";
      }
      text += this.pspm[i][j].toFixed(6);
    }
  }
  return text; 
};

Pspm.prototype.as_score_matrix = function(alphabet, pseudo) {
  "use strict";
  var me, score, out, row, col, score_text;
  me = this;
  if (typeof this.pssm === "undefined") {
    if (!(typeof alphabet === "object" && alphabet != null && alphabet instanceof Alphabet)) {
      throw new Error("The alphabet is required to generate the pssm.");
    }
    if (typeof pseudo === "undefined") {
      pseudo = 0.01;
    } else if (typeof pseudo !== "number" || pseudo < 0) {
      throw new Error("Expected positive number for pseudocount");
    }
    score = function(row, col) {
      "use strict";
      var p, bg, p2;
      p = me.pspm[row][col];
      bg = alphabet.get_bg_freq(col);
      p2 = (p * me.nsites + bg * pseudo) / (me.nsites + pseudo);
      return (p2 > 0 ? Math.round((Math.log(p2 / bg) / Math.LN2) * 100) : -10000);
    };
  } else {
    score = function(row, col) {
      "use strict";
      return me.pssm[row][col];
    };
  }
  out = "";
  for (row = 0; row < this.motif_length; row++) {
    for (col = 0; col < this.alph_length; col++) {
      if (col !== 0) {
        out += " ";
      }
      score_text = "" + score(row, col);
      // pad out to 6 characters
      if (score_text.length < 6) {
        out += (new Array(7 - score_text.length)).join(" ") + score_text;
      } else {
        out += score_text;
      }
    }
    out += "\n";
  }
  return out;
}

Pspm.prototype.as_pspm = function() {
  "use strict";
  return "letter-probability matrix: alength= " + this.alph_length + 
      " w= " + this.motif_length + " nsites= " + this.nsites + 
      " E= " + (typeof this.evalue === "number" ? 
          this.evalue.toExponential() : this.evalue) + "\n" +
      this.as_probability_matrix();
};

Pspm.prototype.as_pssm = function(alphabet, pseudo) {
  "use strict";
  return "log-odds matrix: alength= " + this.alph_length + 
      " w= " + this.motif_length + 
      " E= " + (typeof this.evalue == "number" ?
          this.evalue.toExponential() : this.evalue) + "\n" +
      this.as_score_matrix(alphabet, pseudo);
};

Pspm.prototype.as_meme = function(options) {
  var with_header, with_pspm, with_pssm, version, alphabet, bg_source, pseudocount, strands;
  var out, alen, i;
  // get the options
  if (typeof options !== "object" || options === null) {
    options = {};
  }
  with_header = (typeof options["with_header"] === "boolean" ? options["with_header"] : false);
  with_pspm = (typeof options["with_pspm"] === "boolean" ? options["with_pspm"] : false);
  with_pssm = (typeof options["with_pssm"] === "boolean" ? options["with_pssm"] : false);
  if (!with_pspm && !with_pssm) with_pspm = true;
  if (with_header) {
    if (typeof options["version"] === "string" && /^\d+(?:\.\d+){0,2}$/.test(options["version"])) {
      version = options["version"];
    } else if (typeof options["version"] === "number") {
      version = options["version"].toFixed(0);
    } else {
      version = "4";
    }
    if (typeof options["strands"] === "number" && options["strands"] === 1) {
      strands = 1;
    } else {
      strands = 2;
    }
    if (typeof options["bg_source"] === "string") {
      bg_source = options["bg_source"];
    } else {
      bg_source = "unknown source";
    }
    if (typeof options["alphabet"] === "object" && options["alphabet"] != null
        && options["alphabet"] instanceof Alphabet) {
      alphabet = options["alphabet"];
    } else {
      throw new Error("The alphabet is required to generate the header.");
    }
  }
  // now create the output
  out = "";
  if (with_header) {
    out = "MEME version " + version + "\n\n";
    out += alphabet.as_meme() + "\n";
    if (alphabet.has_complement()) { // assume DNA has both strands unless otherwise specified
      out += "strands: " + (strands === 1 ? "+" : "+ -") + "\n\n";
    }
    out += "Background letter frequencies (from " + bg_source + "):\n";
    alen = alphabet.get_size_core();
    for (i = 0; i < alen; i++) {
      if (i !== 0) {
        if (i % 9 === 0) { // maximum of nine entries per line
          out += "\n";
        } else {
          out += " ";
        }
      }
      out += alphabet.get_symbol(i) + " " + alphabet.get_bg_freq(i).toFixed(3);
    }
  }
  out += "\n\n";
  out += "MOTIF " + this.name + (this.alt == null ? "" : " " + this.alt);
  if (with_pssm) {
    out += "\n\n";
    out += this.as_pssm(options["alphabet"], options["pseudocount"]);
  }
  if (with_pspm) {
    out += "\n\n";
    out += this.as_pspm();
  }
  return out;
}

Pspm.prototype.toString = function() {
  "use strict";
  var str, i, row;
  str = "";
  for (i = 0; i < this.pspm.length; i++) {
    row = this.pspm[i];
    str += row.join("\t") + "\n";
  }
  return str;
};

function parse_pspm_properties(str) {
  "use strict";
  var parts, i, eqpos, before, after, properties, prop, num, num_re;
  num_re = /^((?:[+]?[0-9]*\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|inf)$/;
  parts = trim(str).split(/\s+/);
  // split up words containing =
  for (i = 0; i < parts.length;) {
    eqpos = parts[i].indexOf("=");
    if (eqpos != -1) {
      before = parts[i].substr(0, eqpos);
      after = parts[i].substr(eqpos+1);
      if (before.length > 0 && after.length > 0) {
        parts.splice(i, 1, before, "=", after);
        i += 3;
      } else if (before.length > 0) {
        parts.splice(i, 1, before, "=");
        i += 2;
      } else if (after.length > 0) {
        parts.splice(i, 1, "=", after);
        i += 2;
      } else {
        parts.splice(i, 1, "=");
        i++;
      }
    } else {
      i++;
    }
  }
  properties = {};
  for (i = 0; i < parts.length; i += 3) {
    if (parts.length - i < 3) {
      throw new Error("Expected PSPM property was incomplete. "+
          "Remaing parts are: " + parts.slice(i).join(" "));
    }
    if (parts[i+1] !== "=") {
      throw new Error("Expected '=' in PSPM property between key and " +
          "value but got " + parts[i+1]); 
    }
    prop = parts[i].toLowerCase();
    num = parts[i+2];
    if (!num_re.test(num)) {
      throw new Error("Expected numeric value for PSPM property '" + 
          prop + "' but got '" + num + "'");
    }
    properties[prop] = num;
  }
  return properties;
}

function parse_pspm_string(pspm_string) {
  "use strict";
  var header_re, lines, first_line, line_num, col_num, alph_length, 
      motif_length, nsites, evalue, pspm, i, line, match, props, parts,
      j, prob;
  header_re = /^letter-probability\s+matrix:(.*)$/i;
  lines = pspm_string.split(/\n/);
  first_line = true;
  line_num = 0;
  col_num = 0;
  alph_length;
  motif_length;
  nsites;
  evalue;
  pspm = [];
  for (i = 0; i < lines.length; i++) {
    line = trim(lines[i]);
    if (line.length === 0) { 
      continue;
    }
    // check the first line for a header though allow matrices without it
    if (first_line) {
      first_line = false;
      match = header_re.exec(line);
      if (match !== null) {
        props = parse_pspm_properties(match[1]);
        if (props.hasOwnProperty("alength")) {
          alph_length = parseFloat(props["alength"]);
          if (alph_length != 4 && alph_length != 20) {
            throw new Error("PSPM property alength should be 4 or 20" +
                " but got " + alph_length);
          }
        }
        if (props.hasOwnProperty("w")) {
          motif_length = parseFloat(props["w"]);
          if (motif_length % 1 !== 0 || motif_length < 1) {
            throw new Error("PSPM property w should be an integer larger " +
                "than zero but got " + motif_length);
          }
        }
        if (props.hasOwnProperty("nsites")) {
          nsites = parseFloat(props["nsites"]);
          if (nsites <= 0) {
            throw new Error("PSPM property nsites should be larger than " +
                "zero but got " + nsites);
          }
        }
        if (props.hasOwnProperty("e")) {
          evalue = props["e"];
          if (evalue < 0) {
            throw new Error("PSPM property evalue should be " +
                "non-negative but got " + evalue);
          }
        }
        continue;
      }
    }
    pspm[line_num] = [];
    col_num = 0;
    parts = line.split(/\s+/);
    for (j = 0; j < parts.length; j++) {
      prob = parseFloat(parts[j]);
      if (prob != parts[j] || prob < 0 || prob > 1) {
        throw new Error("Expected probability but got '" + parts[j] + "'"); 
      }
      pspm[line_num][col_num] = prob;
      col_num++;
    }
    line_num++;
  }
  if (typeof motif_length === "number") {
    if (pspm.length != motif_length) {
      throw new Error("Expected PSPM to have a motif length of " + 
          motif_length + " but it was actually " + pspm.length);
    }
  } else {
    motif_length = pspm.length;
  }
  if (typeof alph_length !== "number") {
    alph_length = pspm[0].length;
    if (alph_length != 4 && alph_length != 20) {
      throw new Error("Expected length of first row in the PSPM to be " +
          "either 4 or 20 but got " + alph_length);
    }
  }
  for (i = 0; i < pspm.length; i++) {
    if (pspm[i].length != alph_length) {
      throw new Error("Expected PSPM row " + i + " to have a length of " + 
          alph_length + " but the length was " + pspm[i].length);
    }
  }
  return {"pspm": pspm, "motif_length": motif_length, 
    "alph_length": alph_length, "nsites": nsites, "evalue": evalue};
}
//======================================================================
// end Pspm object
//======================================================================

//======================================================================
// start Logo object
//======================================================================

var Logo = function(alphabet, options) {
  "use strict";
  this.alphabet = alphabet;
  this.fine_text = "";
  this.x_axis = 1;
  this.y_axis = true;
  this.xlate_nsyms = 1;
  this.xlate_start = null;
  this.xlate_end = null;
  this.pspm_list = [];
  this.pspm_column = [];
  this.rows = 0;
  this.columns = 0;
  if (typeof options === "string") {
    // the old method signature had fine_text here so we support that
    this.fine_text = options;
  } else if (typeof options === "object" && options != null) {
    this.fine_text = (typeof options.fine_text === "string" ? options.fine_text : "");
    this.x_axis = (typeof options.x_axis === "boolean" ? (options.x_axis ? 1 : 0) : 1);
    if (options.x_axis_hidden != null && options.x_axis_hidden) this.x_axis = -1;
    this.y_axis = (typeof options.y_axis === "boolean" ? options.y_axis : true);
    this.xlate_nsyms = (typeof options.xlate_nsyms === "number" ? options.xlate_nsyms : this.xlate_nsyms);
    this.xlate_start = (typeof options.xlate_start === "number" ? options.xlate_start : this.xlate_start);
    this.xlate_end = (typeof options.xlate_end === "number" ? options.xlate_end : this.xlate_end);
  }
};

Logo.prototype.add_pspm = function(pspm, column) {
  "use strict";
  var col;
  if (typeof column === "undefined") {
    column = 0;
  } else if (column < 0) {
    throw new Error("Column index out of bounds.");
  }
  this.pspm_list[this.rows] = pspm;
  this.pspm_column[this.rows] = column;
  this.rows++;
  col = column + pspm.get_motif_length();
  if (col > this.columns) {
    this.columns = col;
  }
};

Logo.prototype.get_columns = function() {
  "use strict";
  return this.columns;
};

Logo.prototype.get_xlate_nsyms = function() {
  "use strict";
  return this.xlate_nsyms;
};

Logo.prototype.get_xlate_start = function() {
  "use strict";
  return (this.xlate_start != null ? this.xlate_start : 0);
};

Logo.prototype.get_xlate_end = function() {
  "use strict";
  return (this.xlate_end != null ? this.xlate_end : this.columns * this.xlate_nsyms);
};

Logo.prototype.get_xlate_columns = function() {
  "use strict";
  return this.get_xlate_end() - this.get_xlate_start();
};

Logo.prototype.get_rows = function() {
  "use strict";
  return this.rows;
};

Logo.prototype.get_pspm = function(row_index) {
  "use strict";
  if (row_index < 0 || row_index >= this.rows) {
    throw new Error("INDEX_OUT_OF_BOUNDS");
  }
  return this.pspm_list[row_index];
};

Logo.prototype.get_offset = function(row_index) {
  "use strict";
  if (row_index < 0 || row_index >= this.rows) {
    throw new Error("INDEX_OUT_OF_BOUNDS");
  }
  return this.pspm_column[row_index];
};

Logo.prototype._as_eps_data = function(ssc, errbars) {
  var i, j, pos, stack_pos, pspm, stack, sym, out;
  out = "";
  for (i = 0; i < this.rows; i++) {
    out += "\nStartLine\n";
    // Indent
    for (j = 0; j < this.pspm_column[i]; j++) {
      out += "() startstack\nendstack\n\n";
    }
    pspm = this.pspm_list[i];
    if (pspm.get_left_trim() > 0) {
      out += "MuteColour\nDrawTrimEdge\n" + pspm.get_left_trim() + " DrawTrimBg\n";
    }
    for (pos = 0; pos < pspm.get_motif_length(); pos++) {
      if (pos != 0 && pos == pspm.get_left_trim()) { // enable full colour
        out += "DrawTrimEdge\nRestoreColour\n";
      } else if (pos == (pspm.get_motif_length() - pspm.get_right_trim())) {
        out += "MuteColour\n" + pspm.get_right_trim() + " DrawTrimBg\n";
      }
      out += "(" + (pos + 1) + ") startstack\n";
      stack = pspm.get_stack(pos, this.alphabet, ssc);
      for (stack_pos = 0; stack_pos < stack.length; stack_pos++) {
        sym = stack[stack_pos];
        out += " " + (sym.get_scale() * this.alphabet.get_ic()) + " (" + sym.get_symbol() + ") numchar\n";
      }
      if (errbars) {
        out += " " + pspm.get_error(this.alphabet) + " Ibeam\n";
      }
      out += "endstack\n\n";
    }
    if (pspm.get_right_trim() > 0 || pspm.get_left_trim() == pspm.get_motif_length()) {
      out += "RestoreColour\n";
    }
    out += "EndLine\n";
  }
  return out;
};

Logo.prototype.as_eps = function(options) {
  "use strict";
  if (this.xlate_nsyms != 1) throw new Error("Unsupported setting xlate_nsyms for EPS");
  if (this.xlate_start != null) throw new Error("Unsupported setting xlate_start for EPS");
  if (this.xlate_end != null) throw new Error("Unsupported setting xlate_end for EPS");

  var LOGOHEIGHT = 7.5; // default height of line in cm
  var cm2pts, height, width, now, ssc, errbars;
  if (typeof options === "undefined") {
    options = {};
  }
  cm2pts = 72 / 2.54;
  if (typeof options.logo_height == "number") {
    height = options.logo_height;
  } else {
    height = LOGOHEIGHT * this.rows;
  }
  if (typeof options.logo_width == "number") {
    width = options.logo_width;
  } else {
    width = this.columns + 2;
  }
  now = new Date();
  ssc = (typeof options.ssc == "boolean" ? options.ssc : false);
  errbars = (typeof options.show_error_bar == "boolean" ? options.show_error_bar : ssc);
  var values = {
    "LOGOHEIGHT": height,
    "LOGOWIDTH": width,
    "BOUNDINGHEIGHT": Math.round(height * cm2pts),
    "BOUNDINGWIDTH": Math.round(width * cm2pts),
    "LOGOLINEHEIGHT": (height / this.rows),
    "CHARSPERLINE": this.columns,
    "BARBITS": this.alphabet.get_ic(),
    "LOGOTYPE": (this.alphabet.has_complement() ? "NA" : "AA"),
    "CREATIONDATE": now.getDate() + "." + (now.getMonth() + 1) + "." + now.getFullYear() + " " + now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds(),
    "ERRORBARFRACTION": (typeof options.error_bar_fraction == "number" ? options.error_bar_fraction : 1.0),
    "TICBITS": (typeof options.ticbits == "number" ? options.ticbits : 1.0),
    "TITLE": (typeof options.title == "string" ? options.title : ""),
    "FINEPRINT": (typeof options.fineprint == "string" ? options.fineprint : this.fine_text),
    "XAXISLABEL": (typeof options.xaxislabel == "string" ? options.xaxislabel : ""),
    "YAXISLABEL": (typeof options.yaxislabel == "string" ? options.yaxislabel : "bits"),
    "SSC": ssc,
    "YAXIS": (typeof options.show_y_axis == "boolean" ? options.show_y_axis : this.y_axis),
    "SHOWENDS": (typeof options.show_ends == "boolean" ? options.show_ends : false),
    "ERRBAR": errbars,
    "OUTLINE": (typeof options.show_outline == "boolean" ? options.show_outline : false),
    "NUMBERING": (typeof options.show_numbering == "boolean" ? options.show_numbering : this.x_axis != 0),
    "SHOWINGBOX": (typeof options.show_box == "boolean" ? options.show_box : false),
    "CREATOR": (typeof options.creator == "string" ? options.creator : "motif_logo.js"),
    "FONTSIZE": (typeof options.label_font_size == "number" ? options.label_font_size : 12),
    "TITLEFONTSIZE": (typeof options.title_font_size == "number" ? options.title_font_size : 12),
    "SMALLFONTSIZE": (typeof options.small_font_size == "number" ? options.small_font_size : 6),
    "TOPMARGIN" : (typeof options.top_margin == "number" ? options.top_margin : 0.9),
    "BOTTOMMARGIN": (typeof options.bottom_margin == "number" ? options.bottom_margin : 0.9),
    "COLORDICT": this.alphabet._as_eps_dict(),
    "DATA": this._as_eps_data(ssc, errbars)
  };
  // now this requires that the script containing the template has been imported!
  return motif_logo_template(values);
};

//======================================================================
// end Logo object
//======================================================================

// calculate the exact size (in pixels) of an object drawn on the
// canvas assuming that the background of the canvas is transparent.
function canvas_bounds(ctx, cwidth, cheight) {
  "use strict";
  var data, r, c, top_line, bottom_line, left_line, right_line, 
      txt_width, txt_height;

  // extract the image data
  data = ctx.getImageData(0, 0, cwidth, cheight).data;

  // set initial values
  top_line = -1; bottom_line = -1; left_line = -1; right_line = -1;
  txt_width = 0; txt_height = 0;

  // Find the top-most line with a non-transparent pixel
  for (r = 0; r < cheight; r++) {
    for (c = 0; c < cwidth; c++) {
      if (data[r * cwidth * 4 + c * 4 + 3]) {
        top_line = r;
        break;
      }
    }
    if (top_line != -1) {
      break;
    }
  }
  
  // Only bother looking if we found at least one set pixel... 
  if (top_line != -1) {

    //find the last line with a non-transparent pixel
    for (r = cheight-1; r >= top_line; r--) {
      for(c = 0; c < cwidth; c++) {
        if(data[r * cwidth * 4 + c * 4 + 3]) {
          bottom_line = r;
          break;
        }
      }
      if (bottom_line != -1) {
        break;
      }
    }
    // calculate height
    txt_height = bottom_line - top_line + 1;

    // Find the left-most line with a non-transparent pixel
    for (c = 0; c < cwidth; c++) {
      for (r = top_line; r <= bottom_line; r++) {
        if (data[r * cwidth * 4 + c * 4 + 3]) {
          left_line = c;
          break;
        }
      }
      if (left_line != -1) {
        break;
      }
    }

    //find the right most line with a non-transparent pixel
    for (c = cwidth-1; c >= left_line; c--) {
      for(r = top_line; r <= bottom_line; r++) {
        if(data[r * cwidth * 4 + c * 4 + 3]) {
          right_line = c;
          break;
        }
      }
      if (right_line != -1) {
        break;
      }
    }
    txt_width = right_line - left_line + 1;
  }

  //return the bounds
  return {bound_top: top_line, bound_bottom: bottom_line, 
    bound_left: left_line, bound_right: right_line, width: txt_width, 
    height: txt_height};
}

//======================================================================
// start RasterizedAlphabet
//======================================================================

// Rasterize Alphabet
// 1) Measure width of text at default font for all symbols in alphabet
// 2) sort in width ascending
// 3) Drop the top and bottom 10% (designed to ignore outliers like 'W' and 'I')
// 4) Calculate the average as the maximum scaling factor (designed to stop I becoming a rectangular blob).
// 5) Assume scale of zero would result in width of zero, interpolate scale required to make perfect width font
// 6) Draw text onto temp canvas at calculated scale
// 7) Find bounds of drawn text
// 8) Paint on to another canvas at the desired height (but only scaling width to fit if larger).
var RasterizedAlphabet = function(alphabet, logo_scale, font, width) {
  "use strict";
  var default_size, safety_pad, canvas, ctx, middle, baseline, widths, sizes,
      i, sym, size, tenpercent, avg_width, scale, 
      target_width, target_height;
  //variable prototypes
  this.alphabet = alphabet;
  this.scale = logo_scale;
  this.sym_cache = {};
  this.stack_num_cache = [];
  this.scale_num_cache = [];
  // size of canvas
  default_size = 60; // size of measuring canvas
  safety_pad = 20; // pixels to pad around so we don't miss the edges
  // create a canvas to do our measuring
  canvas = document.createElement("canvas");
  if (!canvas.getContext) throw new Error("No canvas support");
  canvas.width = default_size + 2 * safety_pad;
  canvas.height = default_size + 2 * safety_pad;
  middle = Math.round(canvas.width / 2);
  baseline = Math.round(canvas.height - safety_pad);
  ctx = canvas.getContext('2d');
  if (!supports_text(ctx)) throw new Error("Canvas does not support text");
  ctx.font = font;
  ctx.textAlign = "center";
  ctx.translate(middle, baseline);
  // list of widths
  widths = [];
  sizes = [];
  //now measure each letter in the alphabet
  for (i = 0; i < alphabet.get_size_core(); ++i) {
    // reset the canvas
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    ctx.fillStyle = alphabet.get_colour(i);
    // draw the test text
    ctx.fillText(alphabet.get_symbol(i), 0, 0);
    //measure
    size = canvas_bounds(ctx, canvas.width, canvas.height);
    if (size.width === 0) throw new Error("Invisible symbol!");
    widths.push(size.width);
    sizes[i] = size;
  }
  //sort the widths
  widths.sort(function(a,b) {return a - b;});
  //drop 10% of the items off each end
  tenpercent = Math.floor(widths.length / 10);
  for (i = 0; i < tenpercent; ++i) {
    widths.pop();
    widths.shift();
  }
  //calculate average width
  avg_width = 0;
  for (i = 0; i < widths.length; ++i) {
    avg_width += widths[i];
  }
  avg_width /= widths.length;
  // calculate the target width
  target_width = width * this.scale * 2;
  // calculate scales
  for (i = 0; i < alphabet.get_size_core(); ++i) {
    sym = alphabet.get_symbol(i);
    size = sizes[i];
    // calculate scale
    scale = target_width / Math.max(avg_width, size.width);
    // estimate scaled height
    target_height = size.height * scale;
    // create an appropriately sized canvas
    canvas = document.createElement("canvas");
    canvas.width = target_width;
    canvas.height = target_height + safety_pad * 2;
    // calculate the middle
    middle = Math.round(canvas.width / 2);
    // calculate the baseline
    baseline = Math.round(canvas.height - safety_pad);
    // get the context and prepare to draw the rasterized text
    ctx = canvas.getContext('2d');
    ctx.font = font;
    ctx.fillStyle = alphabet.get_colour(i);
    ctx.textAlign = "center";
    ctx.translate(middle, baseline);
    ctx.save();
    ctx.scale(scale, scale);
    // draw the text
    ctx.fillText(sym, 0, 0);
    ctx.restore();
    this.sym_cache[sym] = {"image": canvas, "size": canvas_bounds(ctx, canvas.width, canvas.height)};
  }
};

RasterizedAlphabet.prototype.get_alphabet = function() {
  return this.alphabet;
};

RasterizedAlphabet.prototype.get_scale = function() {
  return this.scale;
};

RasterizedAlphabet.prototype.draw_stack_sym = function(ctx, letter, dx, dy, dWidth, dHeight) {
  "use strict";
  var entry, image, size;
  entry = this.sym_cache[letter];
  image = entry.image;
  size = entry.size;
  ctx.drawImage(image, 0, size.bound_top -1, image.width, size.height+1, dx, dy, dWidth, dHeight);
};

RasterizedAlphabet.prototype.draw_stack_num = function(ctx, font, stack_width, index) {
  var image, image_ctx, text_length;
  if (index >= this.stack_num_cache.length) {
    image = document.createElement("canvas");
    // measure the text
    image_ctx = image.getContext('2d');
    image_ctx.save();
    image_ctx.font = font;
    text_length = image_ctx.measureText("" + (index + 1)).width;
    image_ctx.restore();
    // resize the canvas to fit
    image.width = Math.ceil(stack_width);
    image.height = Math.ceil(text_length);
    // draw the text
    image_ctx = image.getContext('2d');
    image_ctx.translate(Math.round(stack_width / 2), 0);
    image_ctx.font = font;
    image_ctx.textBaseline = "middle";
    image_ctx.textAlign = "right";
    image_ctx.rotate(-(Math.PI / 2));
    image_ctx.fillText("" + (index + 1), 0, 0);
    this.stack_num_cache[index] = image;
  } else {
    image = this.stack_num_cache[index];
  }
  ctx.drawImage(image, 0, 0);
}

RasterizedAlphabet.prototype.draw_scale_num = function(ctx, font, num) {
  var image, image_ctx, text_size, m_length;
  if (num >= this.scale_num_cache.length) {
    image = document.createElement("canvas");
    // measure the text
    image_ctx = image.getContext('2d');
    image_ctx.font = font;
    text_size = image_ctx.measureText("" + num);
    if (text_size.actualBoundingBoxAscent && text_size.actualBoundingBoxDesent) {
      // resize the canvas to fit
      image.width = Math.ceil(text_size.width);
      image.height = Math.ceil(text_size.actualBoundingBoxAscent + text_size.actualBoundingBoxDesent);
      // draw the text
      image_ctx = image.getContext('2d');
      image_ctx.font = font;
      image_ctx.textAlign = "right";
      image_ctx.fillText("" + num, image.width, text_size.actualBoundingBoxAscent);
    } else {
      // measure width of 'm' to approximate height, we double it later anyway
      m_length = image_ctx.measureText("m").width;
      // resize the canvas to fit
      image.width = Math.ceil(text_size.width);
      image.height = Math.ceil(2 * m_length);
      // draw the text
      image_ctx = image.getContext('2d');
      image_ctx.font = font;
      image_ctx.textAlign = "right";
      image_ctx.textBaseline = "middle";
      image_ctx.fillText("" + num, image.width, m_length);
    }
    this.scale_num_cache[num] = image;
  } else {
    image = this.scale_num_cache[num];
  }
  ctx.drawImage(image, -image.width, -Math.round(image.height / 2))
}

//======================================================================
// end RasterizedAlphabet
//======================================================================

//======================================================================
// start LogoMetrics object
//======================================================================

var LogoMetrics = function(ctx, logo_columns, logo_rows, has_names, has_finetext, x_axis, y_axis) {
  "use strict";
  var i, row_height;
  //variable prototypes
  this.pad_top = (has_names ? 5 : 0);
  this.pad_left = (y_axis ? 10 : 0);
  this.pad_right = (has_finetext ? 15 : 0);
  this.pad_bottom = 0;
  this.pad_middle = 20;
  this.name_height = 14;
  this.name_font = "bold " + this.name_height + "px Times, sans-serif";
  this.name_spacer = 0;
  this.y_axis = y_axis;
  this.y_label = "bits";
  this.y_label_height = 12;
  this.y_label_font = "bold " + this.y_label_height + "px Helvetica, sans-serif";
  this.y_label_spacer = 3;
  this.y_num_height = 12;
  this.y_num_width = 0;
  this.y_num_font = "bold " + this.y_num_height + "px Helvetica, sans-serif";
  this.y_tic_width = 5;
  this.stack_pad_left = 0;
  this.stack_font = "bold 25px Helvetica, sans-serif";
  this.stack_height = 90;
  this.stack_width = 26;
  this.stacks_pad_right = 5;
  this.x_axis = x_axis;
  this.x_num_above = 2;
  this.x_num_height = 12;
  this.x_num_width = 0;
  this.x_num_font = "bold " + this.x_num_height + "px Helvetica, sans-serif";
  this.fine_txt_height = 6;
  this.fine_txt_above = 2;
  this.fine_txt_font = "normal " + this.fine_txt_height + "px Helvetica, sans-serif";
  this.letter_metrics = new Array();
  this.summed_width = 0;
  this.summed_height = 0;
  //calculate the width of the y axis numbers
  ctx.font = this.y_num_font;
  for (i = 0; i <= 2; i++) {
    this.y_num_width = Math.max(this.y_num_width, ctx.measureText("" + i).width);
  }
  //calculate the width of the x axis numbers (but they are rotated so it becomes height)
  if (x_axis == 1) {
    ctx.font = this.x_num_font;
    for (i = 1; i <= logo_columns; i++) {
      this.x_num_width = Math.max(this.x_num_width, ctx.measureText("" + i).width);
    }
  } else if (x_axis == 0) {
    this.x_num_height = 4;
    this.x_num_width = 4;
  } else {
    this.x_num_height = 0;
    this.x_num_width = 0;
  }
  
  //calculate how much vertical space we want to draw this
  //first we add the padding at the top and bottom since that's always there
  this.summed_height += this.pad_top + this.pad_bottom;
  //all except the last row have the same amount of space allocated to them
  if (logo_rows > 1) {
    row_height = this.stack_height + this.pad_middle;
    if (has_names) {
      row_height += this.name_height;
      //the label is allowed to overlap into the spacer
      row_height += Math.max(this.y_num_height/2, this.name_spacer); 
      //the label is allowed to overlap the space used by the other label
      row_height += Math.max(this.y_num_height/2, this.x_num_height + this.x_num_above); 
    } else {
      row_height += this.y_num_height/2; 
      //the label is allowed to overlap the space used by the other label
      row_height += Math.max(this.y_num_height/2, this.x_num_height + this.x_num_above); 
    }
    this.summed_height += row_height * (logo_rows - 1);
  }
  //the last row has the name and fine text below it but no padding
  this.summed_height += this.stack_height + (this.y_axis ? this.y_num_height/2 : 0);

  var fine_txt_total = (has_finetext ? this.fine_txt_height + this.fine_txt_above : 0);
  if (has_names) {
    this.summed_height += fine_txt_total + this.name_height;
    this.summed_height += Math.max((this.y_axis ? this.y_num_height/2 : 0), 
        this.x_num_height + this.x_num_above + this.name_spacer);
  } else {
    this.summed_height += Math.max((this.y_axis ? this.y_num_height/2 : 0), 
        this.x_num_height + this.x_num_above + fine_txt_total);
  }

  //calculate how much horizontal space we want to draw this
  //first add the padding at the left and right since that's always there
  this.summed_width += this.pad_left + this.pad_right;
  if (this.y_axis) {
    //add on the space for the y-axis label
    this.summed_width += this.y_label_height + this.y_label_spacer;
    //add on the space for the y-axis
    this.summed_width += this.y_num_width + this.y_tic_width;
  }
  //add on the space for the stacks
  this.summed_width += (this.stack_pad_left + this.stack_width) * logo_columns;
  //add on the padding after the stacks (an offset from the fine text)
  this.summed_width += this.stacks_pad_right;

};

//======================================================================
// end LogoMetrics object
//======================================================================

//found this trick at http://talideon.com/weblog/2005/02/detecting-broken-images-js.cfm
function image_ok(img) {
  "use strict";
  // During the onload event, IE correctly identifies any images that
  // weren't downloaded as not complete. Others should too. Gecko-based
  // browsers act like NS4 in that they report this incorrectly.
  if (!img.complete) {
    return false;
  }
  // However, they do have two very useful properties: naturalWidth and
  // naturalHeight. These give the true size of the image. If it failed
  // to load, either of these should be zero.
  if (typeof img.naturalWidth !== "undefined" && img.naturalWidth === 0) {
    return false;
  }
  // No other way of checking: assume it's ok.
  return true;
}
  
function supports_text(ctx) {
  "use strict";
  if (!ctx.fillText) {
    return false;
  }
  if (!ctx.measureText) {
    return false;
  }
  return true;
}

//draws the scale, returns the width
function draw_scale(ctx, metrics, alphabet_ic, raster) {
  "use strict";
  var tic_height, i;
  tic_height = metrics.stack_height / alphabet_ic;
  ctx.save();
  ctx.translate(metrics.y_label_height, metrics.y_num_height/2);
  //draw the axis label
  ctx.save();
  ctx.font = metrics.y_label_font;
  ctx.translate(0, metrics.stack_height/2);
  ctx.rotate(-(Math.PI / 2));
  ctx.textAlign = "center";
  ctx.fillText("bits", 0, 0);
  ctx.restore();

  ctx.translate(metrics.y_label_spacer + metrics.y_num_width, 0);

  //draw the axis tics
  ctx.save();
  ctx.translate(0, metrics.stack_height);
  for (i = 0; i <= alphabet_ic; i++) {
    //draw the number
    ctx.save();
    ctx.translate(-1, 0);
    raster.draw_scale_num(ctx, metrics.y_num_font, i);
    ctx.restore();
    //draw the tic
    ctx.fillRect(0, -1, metrics.y_tic_width, 2);
    //prepare for next tic
    ctx.translate(0, -tic_height);
  }
  ctx.restore();

  ctx.fillRect(metrics.y_tic_width - 2, 0, 2, metrics.stack_height)

  ctx.restore();
}

function draw_stack_num(ctx, metrics, row_index, raster) {
  "use strict";
  ctx.save();
  ctx.translate(0, Math.round(metrics.stack_height + metrics.x_num_above));
  if (metrics.x_axis == 1) {
    raster.draw_stack_num(ctx, metrics.x_num_font, metrics.stack_width, row_index);
  } else if (metrics.x_axis == 0) {
    // draw dots instead of the numbers (good for small logos)
    ctx.beginPath();
    var radius = Math.round(metrics.x_num_height / 2);
    ctx.arc(Math.round(metrics.stack_width / 2), radius, radius, 0, 2 * Math.PI, false);
    ctx.fill();
  }
  ctx.restore();
}

function draw_stack(ctx, metrics, symbols, raster) {
  "use strict";
  var preferred_pad, sym_min, i, sym, sym_height, pad;
  preferred_pad = 0;
  sym_min = 5;

  ctx.save();//1
  ctx.translate(0, metrics.stack_height);
  for (i = 0; i < symbols.length; i++) {
    sym = symbols[i];
    sym_height = metrics.stack_height * sym.get_scale();
    
    pad = preferred_pad;
    if (sym_height - pad < sym_min) {
      pad = Math.min(pad, Math.max(0, sym_height - sym_min));
    }
    sym_height -= pad;

    //translate to the correct position
    ctx.translate(0, -(pad/2 + sym_height));

    //draw
    raster.draw_stack_sym(ctx, sym.get_symbol(), 0, 0, metrics.stack_width, sym_height);
    //translate past the padding
    ctx.translate(0, -(pad/2));
  }
  ctx.restore();//1
}

function draw_dashed_line(ctx, pattern, start, x1, y1, x2, y2) {
  "use strict";
  var x, y, len, i, dx, dy, tlen, theta, mulx, muly, lx, ly;
  dx = x2 - x1;
  dy = y2 - y1;
  tlen = Math.pow(dx*dx + dy*dy, 0.5);
  theta = Math.atan2(dy,dx);
  mulx = Math.cos(theta);
  muly = Math.sin(theta);
  lx = [];
  ly = [];
  for (i = 0; i < pattern; ++i) {
    lx.push(pattern[i] * mulx);
    ly.push(pattern[i] * muly);
  }
  i = start;
  x = x1;
  y = y1;
  len = 0;
  ctx.beginPath();
  while (len + pattern[i] < tlen) {
    ctx.moveTo(x, y);
    x += lx[i];
    y += ly[i];
    ctx.lineTo(x, y);
    len += pattern[i];
    i = (i + 1) % pattern.length;
    x += lx[i];
    y += ly[i];
    len += pattern[i];
    i = (i + 1) % pattern.length;
  }
  if (len < tlen) {
    ctx.moveTo(x, y);
    x += mulx * (tlen - len);
    y += muly * (tlen - len);
    ctx.lineTo(x, y);
  }
  ctx.stroke();
}

function draw_trim_background(ctx, metrics, left_start, left_end, left_divider, right_start, right_end, right_divider) {
  "use strict";
  var left_size = left_end - left_start;
  var right_size = right_end - right_start;
  var line_x;

  ctx.save();//s8
  ctx.fillStyle = "rgb(240, 240, 240)";
  if (left_size > 0) {
    ctx.fillRect(left_start * metrics.stack_width, 0, left_size * metrics.stack_width, metrics.stack_height);
  }
  if (right_size > 0) {
    ctx.fillRect(right_start * metrics.stack_width, 0, right_size * metrics.stack_width, metrics.stack_height);
  }
  ctx.fillStyle = "rgb(51, 51, 51)";
  if (left_size > 0 && left_divider) {
    line_x = (left_end * metrics.stack_width) - 0.5;
    draw_dashed_line(ctx, [3], 0, line_x, 0, line_x, metrics.stack_height);
  }
  if (right_size > 0 && right_divider) {
    line_x = (right_start * metrics.stack_width) + 0.5;
    draw_dashed_line(ctx, [3], 0, line_x, 0, line_x, metrics.stack_height);
  }
  ctx.restore();//s8
}

function size_logo_on_canvas(logo, canvas, show_names, scale) {
  "use strict";
  var draw_name, draw_finetext, metrics;
  draw_name = (typeof show_names === "boolean" ? show_names : (logo.get_rows() > 1));
  draw_finetext = (logo.fine_text.length > 0);
  if (canvas.width !== 0 && canvas.height !== 0) {
    return;
  }
  metrics = new LogoMetrics(canvas.getContext('2d'), 
      logo.get_xlate_columns(), logo.get_rows(), draw_name, draw_finetext, logo.x_axis, logo.y_axis);
  if (typeof scale == "number") {
    //resize the canvas to fit the scaled logo
    canvas.width = metrics.summed_width * scale;
    canvas.height = metrics.summed_height * scale;
  } else {
    if (canvas.width === 0 && canvas.height === 0) {
      canvas.width = metrics.summed_width;
      canvas.height = metrics.summed_height;
    } else if (canvas.width === 0) {
      canvas.width = metrics.summed_width * (canvas.height / metrics.summed_height);
    } else if (canvas.height === 0) {
      canvas.height = metrics.summed_height * (canvas.width / metrics.summed_width);
    }
  }
}

function draw_logo_on_canvas(logo, canvas, show_names, scale) {
  "use strict";
  var i, draw_name, draw_finetext, ctx, metrics, raster, pspm_i, pspm, 
      offset, col_index, motif_position, ssc;
  ssc = false;
  draw_name = (typeof show_names === "boolean" ? show_names : (logo.get_rows() > 1));
  draw_finetext = (logo.fine_text.length > 0);
  ctx = canvas.getContext('2d');
  //assume that the user wants the canvas scaled equally so calculate what the best width for this image should be
  metrics = new LogoMetrics(ctx, logo.get_xlate_columns(), logo.get_rows(), draw_name, draw_finetext, logo.x_axis, logo.y_axis);
  if (typeof scale == "number") {
    //resize the canvas to fit the scaled logo
    canvas.width = metrics.summed_width * scale;
    canvas.height = metrics.summed_height * scale;
  } else {
    if (canvas.width === 0 && canvas.height === 0) {
      scale = 1;
      canvas.width = metrics.summed_width;
      canvas.height = metrics.summed_height;
    } else if (canvas.width === 0) {
      scale = canvas.height / metrics.summed_height;
      canvas.width = metrics.summed_width * scale;
    } else if (canvas.height === 0) {
      scale = canvas.width / metrics.summed_width;
      canvas.height = metrics.summed_height * scale;
    } else {
      scale = Math.min(canvas.width / metrics.summed_width, canvas.height / metrics.summed_height);
    }
  }
  // cache the raster based on the assumption that we will be drawing a lot
  // of logos the same size and alphabet
  if (typeof draw_logo_on_canvas.raster_cache === "undefined") {
    draw_logo_on_canvas.raster_cache = [];
  }
  for (i = 0; i < draw_logo_on_canvas.raster_cache.length; i++) {
    raster = draw_logo_on_canvas.raster_cache[i];
    if (raster.get_alphabet().equals(logo.alphabet) &&
        Math.abs(raster.get_scale() - scale) < 0.1) break;
    raster = null;
  }
  if (raster == null) {
    raster = new RasterizedAlphabet(logo.alphabet, scale, metrics.stack_font, metrics.stack_width);
    draw_logo_on_canvas.raster_cache.push(raster);
  }
  ctx = canvas.getContext('2d');
  ctx.save();//s1
  ctx.scale(scale, scale);
  ctx.save();//s2
  ctx.save();//s7
  //create margin
  ctx.translate(Math.round(metrics.pad_left), Math.round(metrics.pad_top));
  for (pspm_i = 0; pspm_i < logo.get_rows(); ++pspm_i) {
    pspm = logo.get_pspm(pspm_i);
    offset = logo.get_offset(pspm_i);
    //optionally draw name if this isn't the last row or is the only row 
    if (draw_name && (logo.get_rows() == 1 || pspm_i != (logo.get_rows()-1))) {
      ctx.save();//s4
      ctx.translate(Math.round(metrics.summed_width/2), Math.round(metrics.name_height));
      ctx.font = metrics.name_font;
      ctx.textAlign = "center";
      ctx.fillText(pspm.name, 0, 0);
      ctx.restore();//s4
      ctx.translate(0, Math.round(metrics.name_height + 
          Math.min(0, metrics.name_spacer - metrics.y_num_height/2)));
    }
    //draw scale
    if (logo.y_axis) draw_scale(ctx, metrics, logo.alphabet.get_ic(), raster);
    ctx.save();//s5
    //translate across past the scale
    if (logo.y_axis) {
      ctx.translate(Math.round(metrics.y_label_height + metrics.y_label_spacer + 
        metrics.y_num_width + metrics.y_tic_width), Math.round(metrics.y_num_height / 2));
    }
    //draw the trimming background
    if (pspm.get_left_trim() > 0 || pspm.get_right_trim() > 0) {
      var left_start = offset * logo.get_xlate_nsyms();
      var left_end = (offset + pspm.get_left_trim()) * logo.get_xlate_nsyms();
      var left_divider = true;
      if (left_end < logo.get_xlate_start() || left_start > logo.get_xlate_end()) {
        // no overlap
        left_start = 0;
        left_end = 0;
        left_divider = false;
      } else {
        if (left_start < logo.get_xlate_start()) {
          left_start = logo.get_xlate_start();
        }
        if (left_end > logo.get_xlate_end()) {
          left_end = logo.get_xlate_end();
          left_divider = false;
        }
        left_start -= logo.get_xlate_start();
        left_end -= logo.get_xlate_start();
        if (left_end < left_start) {
          left_start = 0;
          left_end = 0;
          left_divider = false;
        }
      }
      var right_end = (offset + pspm.get_motif_length()) * logo.get_xlate_nsyms();
      //var right_start = right_end - (pspm.get_left_trim() * logo.get_xlate_nsyms());
      var right_start = right_end - (pspm.get_right_trim() * logo.get_xlate_nsyms());
      var right_divider = true;
      if (right_end < logo.get_xlate_start() || right_start > logo.get_xlate_end()) {
        // no overlap
        right_start = 0;
        right_end = 0;
        right_divider = false;
      } else {
        if (right_start < logo.get_xlate_start()) {
          right_start = logo.get_xlate_start();
          right_divider = false;
        }
        if (right_end > logo.get_xlate_end()) {
          right_end = logo.get_xlate_end();
        }
        right_start -= logo.get_xlate_start();
        right_end -= logo.get_xlate_start();
        if (right_end < right_start) {
          right_start = 0;
          right_end = 0;
          right_divider = false;
        }
      }
      draw_trim_background(ctx, metrics, left_start, left_end, left_divider, right_start, right_end, right_divider);
    }
    //draw letters
    var xlate_col;
    for (xlate_col = logo.get_xlate_start(); xlate_col < logo.get_xlate_end(); xlate_col++) {
      ctx.translate(metrics.stack_pad_left,0);
      col_index = Math.floor(xlate_col / logo.get_xlate_nsyms());
      if (xlate_col % logo.get_xlate_nsyms() == 0) {
        if (col_index >= offset && col_index < (offset + pspm.get_motif_length())) {
          motif_position = col_index - offset;
          draw_stack_num(ctx, metrics, motif_position, raster);
          draw_stack(ctx, metrics, pspm.get_stack(motif_position, logo.alphabet, ssc), raster);
        }
      } else {
        if (col_index >= offset && col_index < (offset + pspm.get_motif_length())) {
          ctx.save();// s5.1
          ctx.translate(0, Math.round(metrics.stack_height));
          // TODO draw a dot or dash or something to indicate continuity of the motif
          ctx.restore(); //s5.1
        }
      }
      ctx.translate(Math.round(metrics.stack_width), 0);
    }
    ctx.restore();//s5
    ////optionally draw name if this is the last row but isn't the only row 
    if (draw_name && (logo.get_rows() != 1 && pspm_i == (logo.get_rows()-1))) {
      //translate vertically past the stack and axis's        
      ctx.translate(0, metrics.y_num_height/2 + metrics.stack_height + 
          Math.max(metrics.y_num_height/2, metrics.x_num_above + metrics.x_num_width + metrics.name_spacer));

      ctx.save();//s6
      ctx.translate(metrics.summed_width/2, metrics.name_height);
      ctx.font = metrics.name_font;
      ctx.textAlign = "center";
      ctx.fillText(pspm.name, 0, 0);
      ctx.restore();//s6
      ctx.translate(0, metrics.name_height);
    } else {
      //translate vertically past the stack and axis's        
      ctx.translate(0, metrics.y_num_height/2 + metrics.stack_height + 
          Math.max(metrics.y_num_height/2, metrics.x_num_above + metrics.x_num_width));
    }
    //if not the last row then add middle padding
    if (pspm_i != (logo.get_rows() -1)) {
      ctx.translate(0, metrics.pad_middle);
    }
  }
  ctx.restore();//s7
  if (logo.fine_text.length > 0) {
    ctx.translate(metrics.summed_width - metrics.pad_right, metrics.summed_height - metrics.pad_bottom);
    ctx.font = metrics.fine_txt_font;
    ctx.textAlign = "right";
    ctx.fillText(logo.fine_text, 0,0);
  }
  ctx.restore();//s2
  ctx.restore();//s1
}

function create_canvas(c_width, c_height, c_id, c_title, c_display) {
  "use strict";
  var canvas = document.createElement("canvas");
  //check for canvas support before attempting anything
  if (!canvas.getContext) {
    return null;
  }
  var ctx = canvas.getContext('2d');
  //check for html5 text drawing support
  if (!supports_text(ctx)) {
    return null;
  }
  //size the canvas
  canvas.width = c_width;
  canvas.height = c_height;
  canvas.id = c_id;
  canvas.title = c_title;
  canvas.style.display = c_display;
  return canvas;
}

function logo_1(alphabet, fine_text, pspm) {
  "use strict";
  var logo = new Logo(alphabet, fine_text);
  logo.add_pspm(pspm);
  return logo;
}

function logo_2(alphabet, fine_text, target, query, query_offset) {
  "use strict";
  var logo = new Logo(alphabet, fine_text);
  if (query_offset < 0) {
    logo.add_pspm(target, -query_offset);
    logo.add_pspm(query);
  } else {
    logo.add_pspm(target);
    logo.add_pspm(query, query_offset);
  }      
  return logo;
}

/*
 * Specifies an alternate source for an image.
 * If the image with the image_id specified has
 * not loaded then a generated logo will be used 
 * to replace it.
 *
 * Note that the image must either have dimensions
 * or a scale must be set.
 */
function alternate_logo(logo, image_id, scale) {
  "use strict";
  var image = document.getElementById(image_id);
  if (!image) {
    alert("Can't find specified image id (" +  image_id + ")");
    return;
  }
  //if the image has loaded then there is no reason to use the canvas
  if (image_ok(image)) {
    return;
  }
  //the image has failed to load so replace it with a canvas if we can.
  var canvas = create_canvas(image.width, image.height, image_id, image.title, image.style.display);
  if (canvas === null) {
    return;
  }
  //draw the logo on the canvas
  draw_logo_on_canvas(logo, canvas, null, scale);
  //replace the image with the canvas
  image.parentNode.replaceChild(canvas, image);
}

/*
 * Specifies that the element with the specified id
 * should be replaced with a generated logo.
 */
function replace_logo(logo, replace_id, scale, title_txt, display_style) {
  "use strict";
  var element = document.getElementById(replace_id);
  if (!replace_id) {
    alert("Can't find specified id (" + replace_id + ")");
    return;
  }
  //found the element!
  var canvas = create_canvas(50, 120, replace_id, title_txt, display_style);
  if (canvas === null) {
    return;
  }
  //draw the logo on the canvas
  draw_logo_on_canvas(logo, canvas, null, scale);
  //replace the element with the canvas
  element.parentNode.replaceChild(canvas, element);
}

/*
 * Fast string trimming implementation found at
 * http://blog.stevenlevithan.com/archives/faster-trim-javascript
 *
 * Note that regex is good at removing leading space but
 * bad at removing trailing space as it has to first go through
 * the whole string.
 */
function trim (str) {
  "use strict";
  var ws, i;
  str = str.replace(/^\s\s*/, '');
  ws = /\s/; i = str.length;
  while (ws.test(str.charAt(--i)));
  return str.slice(0, i + 1);
}

    </script>
    <script type="text/javascript">
//
// simple-shared-doc.js
//
// Function to replace the innerHTML of element "id" with the HTML indicated by "doc_type".
// Easier to read and update than the more flexible approach in shared-doc.js. 
//
function print_doc(id, doc_type) {
  var html;
  switch (doc_type) {
    case 'motif-consensus':
      html = `
	<p id="consensus_doc"> 
	   A <b>consensus sequence</b> is constructed from each column in a
	   motif's frequency matrix using the <b>"50% rule"</b>
	   as follows:
	</p>
	<ol>
	  <li>The letter frequencies in the column are sorted in decreasing order.</li>
	  <li>Letters with frequency less 50% of the maximum are discarded.</li>
	  <li>The letter used in this position in the consensus sequence is determined
	  by the first rule below that applies:</li>
	  <ul>
	    <li>If there is only one letter left, or if the remaining letters exactly match
	    an ambiguous symbol in the alphabet, the <b>letter</b> or <b>ambiguous symbol</b>,
	    respectively, is used.</li>
	    <li>Otherwise, if the remaining set contains at least 50% of the core
	    symbols in the alphabet, the alphabet's <b>wildcard</b>
	    (e.g., "N" for DNA or RNA, and "X" for protein) is used.</li>
	    <li>Otherwise, the letter with the <b>maximum frequency</b> is used.</li>
	  </ul>
	</ol>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'ame-results-header':
      html = `
	<p>
          AME outputs a tab-separated values (TSV) file ('ame.tsv') that contains one line for each motif
	  found to be significantly enriched.
	  The lines are sorted in order of decreasing statistical significance.
          The first line contains the (tab-separated) names of the fields.
	  Your command line is given at the end of the file in a comment line starting with the
	  character '#'.
	</p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'ame-results-table':
      html = `
	<p>
	  The <a href="` + site_url + `/doc/ame-output-format.html#tsv_results">AME Results TSV Format</a> 
	  differs depending on the choice of method for measuring motif enrichment, as shown in the following table. 
	</p>
	<table style="width:100%" border=1>
	  <tr>
	    <th>Method</th>
	    <th colspan=19>Output Columns</th>
	  </tr>
	  <tr>
	    <th></th> 
	    <th>1</th>
	    <th>2</th>
	    <th>3</th>
	    <th>4</th>
	    <th>5</th>
	    <th>6</th>
	    <th>7</th>
	    <th>8</th>
	    <th>9</th>
	    <th>10</th>
	    <th>11</th>
	    <th>12</th>
	    <th>13 </th>
	    <th>14 </th>
	    <th>15 </th>
	    <th>16 </th>
	    <th>17 </th>
	    <th>18 </th>
	    <th>19 </th>
	  </tr>
	  <tr>
	    <td>fisher</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>FASTA_max </td>
	    <td>pos </td>
	    <td>neg </td>
	    <td>PWM_min</td>
	    <td>TP </td>
	    <td>%TP </td>
	    <td>FP </td>
	    <td>%FP </td>
	    </td> <td>
	    </td> <td>
	  </tr>
	  <tr>
	    <td>ranksum</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>FASTA_max </td>
	    <td>pos </td>
	    <td>neg</td>
	    <td>U </td>
	    <td>pleft </td>
	    <td>pright </td>
	    <td>pboth </td>
	    <td>adj_pleft </td>
	    <td>adj_pright </td>
	    <td>adj_both</td>
	  </tr>
	  <tr>
	    <td>3dmhg</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>FASTA_max </td>
	    <td>pos </td>
	    <td>neg</td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	  </tr>
	  <tr>
	    <td>4dmhg</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>FASTA_max </td>
	    <td>pos </td>
	    <td>neg</td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	  </tr>
	  <tr>
	    <td>pearson</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>Pearson_CC </td>
	    <td>mean_squared_error </td>
	    <td>slope </td>
	    <td>intercept</td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	  </tr>
	  <tr>
	    <td>spearman</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>Spearman_CC</td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	  </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'ame-results-description':
      html = `
        <p>
          The names and meanings of each of the fields in <a href="` + site_url + `/doc/ame-output-format.html#tsv_results">AME Results TSV Format</a>,
          which depend on the method of enrichment analysis you chose, are described below.
        </p>
        <table class="dark" style="width:100%" border=1>
	  <tr> <th>method</th> <th>field</th> <th>name</th> <th>contents</th> </tr>	
    	  <tr> <td>all</td> <td>1</td> <td>rank</td> <td>The rank of the significance of the motif in the sorted results.</td> </tr>
    	  <tr> <td>all</td> <td>2</td> <td>motif_DB</td> <td> ` + get_doc_text('motif-db', 'the motif.') + `</td> </tr>
    	  <tr> <td>all</td> <td>3</td> <td>motif_ID</td> <td> ` + get_doc_text('motif-id') + `</td> </tr>
    	  <tr> <td>all</td> <td>4</td> <td>motif_alt_ID</td> <td> ` + get_doc_text('motif-alt-id') + `</td> </tr>
    	  <tr> <td>all</td> <td>5</td> <td>consensus</td> <td> ` + get_doc_text('motif-cons') + `</td> </tr>
    	  <tr> <td>all</td> <td>6</td> <td>p-value</td> <td> ` + get_doc_text('ame-pvalue') + `</td> </tr>
    	  <tr> <td>all</td> <td>7</td> <td>adj_p-value</td> <td> ` + get_doc_text('ame-adj-pvalue') + `</td> </tr>
    	  <tr> <td>all</td> <td>8</td> <td>E-value</td> <td> ` + get_doc_text('ame-evalue') + `</td> </tr>
    	  <tr> <td>all</td> <td>9</td> <td>tests</td> <td>The number of tests performed; used in correcting the <i>p</i>-value</td> </tr>
	  <tr> <td colspan=4></td>
          <tr> <td>fisher, ranksum, 3dmhg, 4dmhg</td> <td>10</td> <td>FASTA_max</td> <td>The optimal threshold for <b>labeling</b> sequences as positive;
            sequences with FASTA score less than or equal to the threshold are labeled as positive;
            this field will be contain the number of primary sequences if you provided
            a control file (using option <code>--control</code>); this field will contain the size of the
            partition if you specified one (using option <code>--fix-partition</code>).</td> </tr>
          <tr> <td>fisher, ranksum, 3dmhg, 4dmhg</td> <td>11</td> <td>pos</td> <td>The number of sequences <b>labeled</b> as positive.</td> </tr>
          <tr> <td>fisher, ranksum, 3dmhg, 4dmhg</td> <td>12</td> <td>neg</td> <td>The number of sequences <b>labeled</b> as negative.</td> </tr>
	  <tr> <td colspan=4></td>
          <tr> <td>fisher</td> <td>13</td> <td>PWM_min</td> <td>The optimal threshold on PWM score for <b>classifying</b> sequences as positive;
                sequences with PWM score greater than or equal to the threshold are classified as positive.</td> </tr>
          <tr> <td>fisher</td> <td>14</td> <td>TP</td> <td>The number of true positive sequences: sequences both <b>labeled</b> and <b>classified</b> as positive</td> </tr>
          <tr> <td>fisher</td> <td>15</td> <td>%TP</td> <td>The percentage of true positive sequences: percentage of sequences <b>labeled</b> positive and <b>classified</b> as positive.</td> </tr>
          <tr> <td>fisher</td> <td>16</td> <td>FP</td> <td>The number of false positive sequences: sequences <b>labeled</b> negative but <b>classified</b> as positive.</td> </tr>
          <tr> <td>fisher</td> <td>17</td> <td>%TP</td> <td>The percentage of false positive sequences: sequences <b>labeled</b> negative but <b>classified</b> as positive.</td> </tr>
	  <tr> <td colspan=4></td>
          <tr> <td>ranksum</td> <td>13</td> <td>U</td> <td>The value of the Mann-Whitney <i>U</i> statistic.</td> </tr>
          <tr> <td>ranksum</td> <td>14</td> <td>pleft</td> <td>The left-tailed <i>p</i>-value of the rank-sum test.</td> </tr>
          <tr> <td>ranksum</td> <td>15</td> <td>pright</td> <td>The right-tailed <i>p</i>-value of the rank-sum test.</td> </tr>
          <tr> <td>ranksum</td> <td>16</td> <td>pboth</td> <td>The two-tailed <i>p</i>-value of the rank-sum test.</td> </tr>
          <tr> <td>ranksum</td> <td>17</td> <td>adj_pleft</td> <td>The left-tailed <i>p</i>-value of the rank-sum test, adjusted for multiple tests.</td> </tr>
          <tr> <td>ranksum</td> <td>18</td> <td>adj_pright</td> <td>The right-tailed <i>p</i>-value of the rank-sum test, adjusted for multiple tests.</td> </tr>
          <tr> <td>ranksum</td> <td>19</td> <td>adj_both</td> <td>The two-tailed <i>p</i>-value of the rank-sum test, adjusted for multiple tests.</td> </tr>
	  <tr> <td colspan=4></td>
	  <tr> <td>pearson</td> <td>10</td> <td>Pearson_CC</td> <td>The correlation coefficient of the PWM and FASTA scores of positive sequences.</td> </tr>
	  <tr> <td>pearson</td> <td>11</td> <td>mean_squared_error</td> <td>The mean-squared error of the regression line between PWM and FASTA scores.</td> </tr>
	  <tr> <td>pearson</td> <td>12</td> <td>slope</td> <td>The slope of the regression line.</td> </tr>
	  <tr> <td>pearson</td> <td>13</td> <td>intercept</td> <td>The y-intercept of the regression line.</td> </tr>
	  <tr> <td colspan=4></td>
	  <tr> <td>spearman</td> <td>10</td> <td>Spearman_CC</td> <td>The correlation coefficient of the PWM and FASTA ranks of positive sequences./td> </tr>
        </table>
	  </ul>
	</p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'ame-sequences-tsv':
      html = `
        <p>AME outputs a tab-separated values (TSV) file ('sequences.tsv') containing one line for
	each sequence classified as 'positive' by AME for each significant motif.
        The first line contains the (tab-separated) names of the fields.
	The lines are grouped by motif, and groups are separated by a line
	starting with the character "#".
        </p>
        <p>
          The names and meanings of each of the fields in <a href="` + site_url + `/doc/ame-output-format.html#tsv_sequences">AME Significant Sequences TSV Format</a>,
          are described below.
        </p>
        <table class="dark" style="width:100%" border=1>
          <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
	  <tr> <td>1</td> <td>motif_DB</td> <td>` + get_doc_text('motif-db', 'the motif.') + `</td> </tr>
	  <tr> <td>2</td> <td>motif_ID</td> <td>the ID of the motif</td> </tr>
	  <tr> <td>3</td> <td>seq_ID</td> <td>the ID of the sequence</td> </tr>
	  <tr> <td>4</td> <td><i>label_score</i> (either FASTA_score or PWM_score)</td> <td>the value of the score used to label it as positive</td> </tr>
	  <tr> <td>5</td> <td><i>class_score</i> (either PWM_score or FASTA_score)</td> <td>the value of the score used to classify it as positive</td> </tr>
	  <tr> <td>6</td> <td>class</td> <td>whether the sequence is a true positive, 'tp', or a false positive, 'fp'</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'centrimo-results-tsv':
      html = `
	<p>
          CentriMo outputs a tab-separated values (TSV) file ('centrimo.tsv') that contains one line for each 
	  region found to be significantly enriched for a motif.
	  The lines are sorted in order of decreasing statistical significance.
          The first line contains the (tab-separated) names of the fields.
          Your command line is given at the end of the file in a comment line starting with the
          character '#'.
	</p>
	<p>
          The names and meanings of each of the fields in <a href="` + site_url + `/doc/centrimo-output-format.html#tsv_results">CentriMo Results TSV Format</a>,
          which depend on whether or not you provide control sequences to CentriMo, are described below.
	</p>
        <table class="dark" style="width:100%" border=1>
          <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
	  <tr> <td>1</td> <td>db_index</td> <td>The index of the motif file that contains the motif.  Motif
	      files are numbered in the order the appeared in the command line.</td> </tr>
	  <tr> <td>2</td> <td>motif_id</td> <td> ` + get_doc_text('motif-id') + `
	      If more than one motif has the same ID, CentriMo uses only the first such motif.
	      The name is single-quoted and preceded with '+' or '-' if you scanned separately with 
	      the reverse complement motif (using the <code>--sep</code> option).</td> </tr>
	  <tr> <td>3</td> <td>motif_alt_id</td> <td> ` + get_doc_text('motif-alt-id') + `</td> </tr>
	  <tr> <td>4</td> <td>consensus</td> <td> ` + get_doc_text('motif-cons') + `</td> </tr>
	  <tr> <td>5</td> <td>E-value</td> <td> ` + get_doc_text('centrimo-evalue') + `</td> </tr>
	  <tr> <td>6</td> <td>adj_p-value</td> <td> ` + get_doc_text('centrimo-adj-pvalue') + `
	      By default, a <i>p</i>-value is calculated by using the one-tailed binomial
	      test on the number of sequences with a match to the motif
	      that have their best match in the reported region;
              if you provided control sequences, the <i>p</i>-value of Fisher\'s exact test on the enrichment of 
              best matches in the positive sequences relative to the negative sequences is computed instead;
	      if you used the <code>--cd</code> option, the <i>p</i>-value is the probability that the average 
	      distance between the best site and the sequence center would be as low or lower than observed, 
	      computed using the cumulative Bates distribution, optimized over different score thresholds.
	      In all cases, the reported <i>p</i>-value has been adjusted for the number of regions
	      and/or score thresholds tested.</td> </tr>
	  <tr> <td>7</td> <td>log_adj_p-value</td> <td>Log of adjusted <i>p</i>-value.</td> </tr>
	  <tr> <td>8</td> <td>bin_location</td> <td>Location of the center of the most enriched region, or
		0 if you used the <code>--cd</code> option.
	  <tr> <td>9</td> <td>bin_width</td> <td> ` + get_doc_text('centrimo-bin-width') + `</td> </tr>
	  <tr> <td>10</td> <td>total_width</td> <td>The maximum number of regions possible for this motif
              <br>&nbsp;&nbsp;
	      round(sequence_length - motif_length + 1)/2,<br>
	      or the number of places the motif will fit if you used the <code>--cd</code> option.</td> </tr>
	  <tr> <td>11</td> <td>sites_in_bin</td> <td> ` + get_doc_text('centrimo-sites-in-bin') + `</td> </tr>
	  <tr> <td>12</td> <td>total_sites</td> <td>The number of sequences containing a match to the motif
	      above the score threshold.
	  <tr> <td>13</td> <td>p_success</td> <td>The probability of a random match falling into the enriched region:
	      <br>&nbsp;&nbsp;
	      bin_width / total_width</td> </tr>
	  <tr> <td>14</td> <td>p-value</td> <td>The uncorrected <i>p</i>-value before it gets adjusted for the
	      number of multiple tests to give the adjusted <i>p</i>-value.</td> </tr>
	  <tr> <td>15</td> <td>mult_tests</td> <td> ` + get_doc_text('centrimo-mult-tests') + `</td> </tr>
	  <tr> <th colspan=3>The following additional columns are present when you provide control sequences to CentriMo
	  (using the <code>--neg</code> option).</th> </tr>
	  <tr> <td>16</td> <td>neg_sites_in_bin</td> <td>The number of negative sequences where the best
	      match to the motif falls in the reported region.
	      This value is rounded but the underlying value may contain fractional counts.
	      Note: This number may be less than the number of negative have a best match in the region.
	      The reason for this is that a sequence may have many matches that score equally best.
	      If n matches have the best score in a sequence, 1/n is added to the
	      appropriate bin for each match.</td> </tr>
	  <tr> <td>17</td> <td>neg_sites</td> <td>The number of negative sequences containing a match to the
	      motif above the minimum score threshold.
	      When score optimization is enabled the score threshold may be raised
	      higher than the minimum.</td> </tr>
	  <tr> <td>18</td> <td>neg_adj_pvalue</td> <td>The probability that any tested region in the negative
	      sequences would be as enriched for best matches to this motif
	      according to the Binomial test.</td> </tr>
	  <tr> <td>19</td> <td>log_neg_adj_pvalue</td> <td>Log of negative adjusted <i>p</i>-value.</td> </tr>
	  <tr> <td>20</td> <td>fisher_adj_pvalue</td> <td>Fisher adjusted <i>p</i>-value before it gets adjusted for the
	      number of motifs in the input files(s).</td> </tr>
	  <tr> <td>21</td> <td>log_fisher_adj_pvalue</td> <td>Log of Fisher adjusted <i>p</i>-value.</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'centrimo-sites-txt':
      html = `
	<p>
          CentriMo outputs a text file ('site_counts.txt') that contains,
	  for each motif, pairs of values (bin_position, site_count),
	  or triples of values (bin_position, site_count, neg_site_count) if
	  you provided control sequences to CentriMo.
	  This data can be used to plot the density of motif best matches (sites)
	  along the input sequences.  Fractional counts are possible if multiple (n)
	  bins contain the best match for a given sequence, with each bin  
	  receiving an incremental count of 1/n. 
	</p>
	<p>
	  The data for each motif begins with a header line with the format:
	  <br>&nbsp&nbsp
		DB &lt;db_number&gt; MOTIF &lt;id&gt; &lt;alt&gt;
	  </br>
	  where &lt;id&gt; and &lt;alt&gt; are as described above.
	  The following lines (up to the next header line) 
	  each contain a single value-pair or value-triple for the motif
	  named in the header line.
	</p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'meme-chip-results-tsv':
      html = `
	<p>
          MEME-ChIP outputs a tab-separated values (TSV) file ('summary.tsv') that 
	  contains one line for each motif found by MEME-ChIP.
	  The lines are sorted in order of decreasing statistical significance.
	  The first line contains the (tab-separated) names of the fields.
	  Your command line is given at the end of the file in a comment line starting with the
	  character '#'.
	</p>
	<p>
          The names and meanings of the fields in the 
	  <a href="` + site_url + `/doc/meme-chip-output-format.html">MEME-ChIP Results Summary TSV Format</a> 
	  are described below. 
	</p>
        <table class="dark" style="width:100%" border=1>
          <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>MOTIF_INDEX</td> <td>The index of the motif in the "Motifs in MEME text format" file ('combined.meme') 
		output by MEME-ChIP.</td> </tr>
          <tr> <td>2</td> <td>MOTIF_SOURCE</td> <td>The name of the program that found the <i>de novo</i> motif, or the
                name of the motif file containing the known motif.</td> </tr>
          <tr> <td>3</td> <td>MOTIF_ID</td> <td> ` + get_doc_text('motif-id') + `</td> </tr>
          <tr> <td>4</td> <td>ALT_ID</td> <td> ` + get_doc_text('motif-alt-id') + `</td> </tr>
          <tr> <td>5</td> <td>CONSENSUS</td> <td>The ID of the <i>de novo</i> motif, or a consensus sequence
                computed from the letter frequencies in the known motif
                (as described <a href="#consensus_doc">below</a>).</td> </tr>
          <tr> <td>6</td> <td>WIDTH</td> <td>The width of the motif.</td> </tr>
          <tr> <td>7</td> <td>SITES</td> <td>The number of sites reported by the <i>de novo</i> program, or the number
                of "Total Matches" reported by CentriMo.</td> </tr>
          <tr> <td>8</td> <td>E-VALUE</td> <td>The statistical significance of the motif.</td> </tr>
          <tr> <td>9</td> <td>E-VALUE_SOURCE</td> <td>The program that reported the <i>E</i>-value.</td> </tr>
          <tr> <td>10</td> <td>MOST_SIMILAR_MOTIF</td> <td>The known motif most similar to this motif according to Tomtom.</td> </tr>
          <tr> <td>11</td> <td>URL</td> <td>A link to a description of the most similar motif, or to the known motif.</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'meme-chip-combined-motifs':
      html = `
        <p>
          MEME-ChIP outputs a text file ('combined.meme') containing all the significant motifs found by MEME-ChIP.
          The motifs are in <a href="` + site_url + `/doc/meme-format.html">Minimal MEME Motif format</a>, 
	  and their IDs correspond to the motif indices given in the "Summary in TSV Format" file ('summary.tsv').
        </p>
        </p>
          <b>Note:</b> The 'nsites=' and 'E=' fields in the motif headers are only
          relevant for the MEME and DREME motifs.  For known motifs, those values do
          not refer to the number of sites in the input sequences.
        </p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'spamo-results-tsv':
      html = `
	<p>
          SpaMo outputs a tab-separated values (TSV) file ('spamo.tsv') that contains one line for each motif
	  found to be significantly enriched.
	  The lines are grouped by secondary motif and sorted in order of decreasing statistical significance.
          The first line contains the (tab-separated) names of the fields.
	  Your command line is given at the end of the file in a comment line starting with the character '#'.
	</p>
	<p>
	  The names and meanings of each of the fields in <a href="` + site_url + `/doc/spamo-output-format.html#results-tsv">SpaMo Results TSV Format</a> 
	  are described below. 
	</p>
	<table class="dark" style="width:100%" border=1>
	  <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>prim_db</td> <td> ` + get_doc_text('motif-db', 'the primary motif.') + `</td> </tr>
          <tr> <td>2</td> <td>prim_id</td> <td> ` + get_doc_text('motif-id', 'primary') + `</td> </tr>
          <tr> <td>3</td> <td>prim_alt</td> <td> ` + get_doc_text('motif-alt-id', 'primary') + `</td> </tr>
          <tr> <td>4</td> <td>prim_cons</td> <td> ` + get_doc_text('motif-cons', 'primary') + `</td> </tr>
          <tr> <td>5</td> <td>sec_db</td> <td> ` + get_doc_text('motif-db', 'the secondary motif.') + `</td> </tr>
          <tr> <td>6</td> <td>sec_id</td> <td> ` + get_doc_text('motif-id', 'secondary') + `</td> </tr>
          <tr> <td>7</td> <td>sec_alt</td> <td> ` + get_doc_text('motif-alt-id', 'secondary') + `</td> </tr>
          <tr> <td>8</td> <td>sec_cons</td> <td> ` + get_doc_text('motif-cons', 'secondary') + `</td> </tr>
          <tr> <td>9</td> <td>trim_left</td> <td>Number of positions trimmed from left of secondary motif.</td> </tr>
          <tr> <td>10</td> <td>trim_right</td> <td>Number of positions trimmed from right of secondary motif.</td> </tr> 
          <tr> <th colspan=3>If the next three fields are not blank, the motif is redundant with a more significant ('parent') motif.</th> </tr>
          <tr> <td>11</td> <td>red_db</td> <td> ` + get_doc_text('motif-db', 'the parent motif.') + `</td> </tr>
          <tr> <td>12</td> <td>red_id</td> <td> ` + get_doc_text('motif-id', 'parent') + `</td> </tr>
          <tr> <td>13</td> <td>red_alt</td> <td> ` + get_doc_text('motif-alt-id', 'parent') + `</td> </tr>
          <tr> <td>14</td> <td>E-value</td> <td>The expected number motifs that would have least one spacing as enriched as the best spacing for this secondary. 
	    The <i>E</i>-value is the best spacing <i>p</i>-value multiplied by the number of motifs in the input database(s).</td> </tr>
          <tr> <td>15</td> <td>gap</td> <td>The distance between the edge of the primary and the (trimmed) secondary motif.</td> </tr>
          <tr> <td>16</td> <td>orient</td> <td>The (combination) of quadrants for which occurrences of this spacing are combined.</td> </tr>
          <tr> <td>17</td> <td>count</td> <td>The number of occurrences of the secondary motif with the given spacing and orientation to the primary motif.</td> </tr>
          <tr> <td>18</td> <td>total</td> <td>The total number of occurrences of the secondary motif within the margins around the best primary motif occurrence.</td> </tr>
          <tr> <td>19</td> <td>adj_p-value</td> <td>The <i>p</i>-value of the gap and orientation, adjusted for nine combinations of quadrants times the number of gaps tested (as controlled by the <code>-range</code> option).</td> </tr>
          <tr> <td>20</td> <td>p-value</td> <td>The <i>p</i>-value of the gap and orientation adjusted only for the number of gaps tested.</td> </tr>
        </table>
        <br>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'spamo-dumpseqs-tsv':
      html = `
	<p>
	  By specifying the options <code>--dumpseqs</code> or <code>--dumpsigs</code> 
	  you can have SpaMo create TSV (tab-separated values) files
	  describing the motif matches SpaMo used to make the histograms in its HTML output.
	  The files are named 
          '<code>seqs_&lt;primary_motif&gt;_&lt;secondary_db&gt;_&lt;secondary_motif&gt;.txt</code>'.
	  The rows in each file are sorted by sequence name.  
	  The first line contains the (tab-separated) names of the fields.
        </p>
	<p>
	  The names and meanings of each of the fields in <a href="` + site_url + `/doc/spamo-output-format.html#tsv_dumpseqs">SpaMo Dumpseqs TSV Format</a> 
	  are described below. 
        </p>
	<table class="dark" style="width:100%">
	  <tr><th>field</th><th>name</th><th>contents</th></tr>
	  <tr><td>1</td><td>matches</td><td>Trimmed lowercase sequence centered on primary match with matches in uppercase.</td></tr>
	  <tr><td>2</td><td>sec_pos</td><td>Position of the secondary match within the whole sequence.</td></tr>
	  <tr><td>3</td><td>pri_match</td><td>Sequence fragment that the primary matched.</td></tr>
	  <tr><td>4</td><td>pri_strand</td><td>Strand of the primary match (+/-).</td></tr>
	  <tr><td>5</td><td>sec_match</td><td>Sequence fragment that the secondary matched.</td></tr>
	  <tr><td>6</td><td>sec_strand</td><td>Strand of the secondary match (+/-).</td></tr>
	  <tr><td>7</td><td>same_opp</td><td>The primary match on the same (s) or opposite (o) strand as the secondary.</td></tr>
	  <tr><td>8</td><td>down_up</td><td>The secondary match is downstream (d) or upstream (u) of the primary.</td></tr>
	  <tr><td>9</td><td>gap</td><td>The gap between the primary and secondary matches.</td></tr>
	  <tr><td>10</td><td>seq_name</td><td>The name of the sequence.</td></tr>
	  <tr><td>11</td><td>adj_p-value</td><td>The <i>p</i>-value of the bin containing the match, adjusted for the number of bins.</td></tr>
	  <tr><th colspan="3">If the sequence names are in UCSC Genome Browser position
	  format (e.g., "chr5:36715616-36715623"), the following additional fields will be present:</th></tr>
	  <tr><td>12</td><td>pri_bed_chr</td><td>Position of primary match in BED coordinates.</td></tr>
	  <tr><td>13</td><td>pri_bed_start</td><td>"</td></tr>
	  <tr><td>14</td><td>pri_bed_end</td><td>"</td></tr>
	  <tr><td>15</td><td>pri_browser</td><td>Position of primary match in UCSC Genome Browser coordinates.</td></tr>
	  <tr><td>16</td><td>sec_bed_chr</td><td>Position of secondary match in BED coordinates.</td></tr>
	  <tr><td>16</td><td>sec_bed_start</td><td>"</td></tr>
	  <tr><td>16</td><td>sec_bed_end</td><td>"</td></tr>
	  <tr><td>19</td><td>sec_browser</td><td>Position of secondary match in UCSC Genome Browser coordinates.</td></tr>
	</table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'fimo-results-tsv':
      html = ` 
        <p>
          FIMO outputs a tab-separated values (TSV) file ('fimo.tsv') that contains one line for each
          significant match to a motif.
          The lines are sorted in order of decreasing statistical significance (increasing <i>p</i>-value).
          The first line contains the (tab-separated) names of the fields.
          Your command line is given at the end of the file in a comment line starting with the
          character '#'.
        </p>
	<p>
	  The names and meanings of each of the fields in <a href="` + site_url + `/doc/fimo-output-format.html#results-tsv">FIMO Results TSV Format</a> 
	  are described below. 
	</p>
	<table class="dark" style="width:100%" border=1>
	  <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>motif_id</td> <td> ` + get_doc_text('motif-id') + `</td> </tr>
          <tr> <td>2</td> <td>motif_alt_id</td> <td> ` + get_doc_text('motif-alt-id') + `</td> </tr>
          <tr> <td>3</td> <td>sequence_name</td> <td> ` + get_doc_text('sequence-id') + ` --OR-- the `
	    + get_doc_text('sequence-name') + `</td> </tr>
          <tr> <td>4</td> <td>start</td> <td> ` + get_doc_text('match-start-seq', 'motif occurrence') + ` --OR-- `
            + get_doc_text('match-start-genomic', 'motif occurrence') 
            + get_doc_text('parse-genomic-coord', 'The latter case occurs when FIMO') + `</td> </tr>
          <tr> <td>5</td> <td>stop</td> <td> ` + get_doc_text('match-stop-seq', 'motif occurrence') + ` --OR-- `
            + get_doc_text('match-stop-genomic', 'motif occurrence') 
            + get_doc_text('parse-genomic-coord', 'The latter case occurs when FIMO') + `</td> </tr>
          <tr> <td>6</td> <td>strand</td> <td>The strand '<code>+</code>' indicates the motif matched the forward
	    strand, '<code>-</code>' the reverse strand, and '<code>.</code>'
	    indicates strand is not applicable (as for amino acid sequences).</td> </tr>
          <tr> <td>7</td> <td>score</td> <td>The score for the motif occurrence. `
            + get_doc_text('motif-match-score') + `</td> </tr>
          <tr> <td>8</td> <td>p-value</td> <td> The <i>p</i>-value of the motif occurrence. `
            + get_doc_text('motif-match-p-value') + `</td> </tr>
          <tr> <td>9</td> <td>q-value</td> <td>The q-value of the motif occurrence. `
            + get_doc_text('bh-q-value', 'FIMO') + ` <b>Note:</b> This column is empty if you used the <span class=popt>--text</span> switch.</td> </tr>
          <tr> <td>10</td> <td>sequence</td> <td>The region of the sequence matched to the motif.</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'fimo-results-gff3':
      html = `
        <p>
          FIMO outputs a GFF3</a> file ('fimo.gff') that contains one line for each
          significant match to a motif.
        </p>
        <p>
	  The GFF3 format is described <a href="http://gmod.org/wiki/GFF3">here</a>.
	  The 'score' reported in the FIMO GFF3 output</a> (in column 6) is<br/>
	  &nbsp;&nbsp;&nbsp;&nbsp;<code>min(1000, -10*(log10(pvalue)))</code>, <br/>
	  and the 'display name' ('Name=' tag in column 9) is composed of the contents of three 
	  fields as follows <br/>
	  &nbsp;&nbsp;&nbsp;&nbsp;<code>&lt;motif_id&gt;_&lt;sequence_name&gt;&lt;strand&gt;</code>.
        </p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'gomo-results-tsv':
      html = `
        <p>
          GOMo outputs a tab-separated values (TSV) file ('gomo.tsv') that contains one line for each 
	  motif-GO-term pair found to be significantly enriched.
          The lines are grouped by motif and sorted in order of decreasing statistical significance.
          The first line contains the (tab-separated) names of the fields.
          Your command line is given at the end of the file in a comment line starting with the character '#'.
        </p>
        <p>
          The names and meanings of each of the fields in <a href="` + site_url + `/doc/gomo-output-format.html#results-tsv">GOMo Results TSV Format</a>
          are described below.
        </p>
        <table class="dark" style="width:100%" border=1>
          <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>Motif_Identifier</td> <td> ` + get_doc_text('motif-id') + ` </td> </tr> 
          <tr> <td>2</td> <td>GO_Term_Identifier</td> <td> ` + get_doc_text('gomo-go-term') + ` </td> </tr>
          <tr> <td>3</td> <td>GOMo_Score</td> <td> ` + get_doc_text('gomo-score') + ` </td> </tr>
          <tr> <td>4</td> <td>p-value</td> <td> ` + get_doc_text('gomo-p-value') + ` </td> </tr>
          <tr> <td>5</td> <td>q-value</td> <td> ` + get_doc_text('bh-q-value', 'GOMo') + ` </td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'gomo-results-xml':
      html = `
	<p>
	GOMo outputs an XML file ('gomo.xml') with the following format.
	</p>
	<table class="bordertable" border="1">
	  <tr>
	    <th>Tag</th><th>Child of</th><th>Description</th>
	  </tr>
	  <tr>
	    <td >&lt;gomo&gt;</td><td >Nothing</td>
	    <td>
	      Information about this run of GOMo.
	      <ul>
		<li>version - The version of GOMo that generated the XML file.</li>
		<li>release - The release date of the version that generated the XML.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td >&lt;program&gt;</td>
	    <td >&lt;gomo&gt;</td>
	    <td>
	      Information about the state of the program when it ran.<br />
	      <ul>
		<li>name - name of the program.</li>
		<li>cmd - the command line passed to the program.</li>
		<li>gene_url - the url used to lookup further information on the gene ids. 
		The url has ampersands (&amp;) converted into <b>&amp;amp;</b> and the place where
		  the gene ID should be replaced by <b>!!GENEID!!</b> .</li>
		<li>outdir - the output directory that the program wrote to.</li>
		<li>clobber - true if GOMo was allowed to overwrite the output directory.</li>
		<li>text_only - true if GOMo wrote to stdout, in which case this file would
		  not exist so it must be false.</li>
		<li>use_e_values - true if GOMo used <i>E</i>-values (converted from <i>p</i>-values) as 
		  input scores, false if GOMo used gene scores.</li>
		<li>score_e_thresh - if GOMo used <i>E</i>-values then this is the threshold that 
		  GOMo assumed the worst <i>E</i>-value (<i>p</i>-value = 1.0) for the gene to smooth out noise.</li>
		<li>min_gene_count - the minimum number of genes that a GO term was annotated 
		  with before GOMo would calculate a score for it.</li>
		<li>motifs - if present then a space delimited list of the motifs that GOMo
		  calculated a score for, otherwise GOMo scored all motifs.</li>
		<li>shuffle_scores - the number of times GOMo generated a shuffled mapping of
		  gene id to gene id to be used to generate scores from the null model.</li>
		<li>q_threshold - GOMo filtered the results to only show those with a better
		(smaller) q-value.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td>&lt;gomapfile&gt;</td>
	    <td>&lt;program&gt;</td>
	    <td>
	      Information about the GO mapping file.<br />
	      <ul>
		<li>path - the path to the mapping file.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td>&lt;seqscorefile&gt;</td>
	    <td>&lt;program&gt;</td>
	    <td>
	      Information about the sequence scoring file.<br />
	      <ul>
		<li>path - the path to the sequence scoring file.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td>&lt;motif&gt;</td>
	    <td>&lt;gomo&gt;</td>
	    <td>
	      Information about the motif.<br />
	      <ul>
		<li>id - the motif identifier.</li>
		<li>genecount - the number of scored sequences that were used to compute the result.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td>&lt;goterm&gt;</td>
	    <td>&lt;motif&gt;</td>
	    <td>
	      Information about the GO term.<br />
	      <ul>
		<li>id - the GO identifier.</li>
		<li>score - the geometric mean across all species of the rank-sum test <i>p</i>-value.</li>
		<li>pvalue - the empirically calculated <i>p</i>-value.</li>
		<li>qvalue - the empirically calculated q-value.</li>
		<li>annotated - the number of genes annotated with the go term.</li>
		<li>group - the subgroup that the term belongs to. For the Gene Ontology 
		    b = biological process, c = cellular component and m = molecular function.</li>
		<li>nabove - the number of more general terms that link to this one.</li>
		<li>nbelow - the number of more specific terms that link from this one.</li>
		<li>implied - is the go term implied by other significant go terms? 
		  Allows values 'y', 'n' or 'u' (default) for yes, no or unknown.</li>
		<li>description - the GO term description.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td>&lt;gene&gt;</td>
	    <td>&lt;goterm&gt;</td>
	    <td>
	      Information about the GO term's annotated genes for the primary species.<br />
	      <ul>
		<li>id - the gene identifier.</li>
		<li>rank - the rank of the scored gene.</li>
	      </ul>
	    </td>
	  </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'mcast-results-tsv':
      html = ` 
        <p>
          MCAST outputs a tab-separated values (TSV) file ('mcast.tsv') that contains one line for each
          significant match of a cluster of motifs to a sequence region.
          The lines are sorted in order of decreasing statistical significance (increasing <i>p</i>-value).
          The first line contains the (tab-separated) names of the fields.
          Your command line is given at the end of the file in a comment line starting with the
          character '#'.
        </p>
	<p>
	  The names and meanings of each of the fields in 
          <a href="` + site_url + `/doc/mcast-output-format.html#results-tsv">MCAST Results TSV Format</a> 
	  are described below. 
	</p>
	<table class="dark" style="width:100%" border=1>
	  <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>pattern_name</td> <td>A unique name that MCAST generates for the match. </td> </tr>
          <tr> <td>2</td> <td>sequence_name</td> <td> ` + get_doc_text('sequence-id') + ` --OR-- the `
	    + get_doc_text('sequence-name') + `</td> </tr>
          <tr> <td>3</td> <td>start</td> <td> ` + get_doc_text('match-start-seq', 'matched sequence region') + ` --OR-- `
            + get_doc_text('match-start-genomic', 'motif occurrence')
            + get_doc_text('parse-genomic-coord', 'The latter case occurs when MCAST') + `</td> </tr>
          <tr> <td>4</td> <td>stop</td> <td> ` + get_doc_text('match-stop-seq', 'matched sequence region') + ` --OR-- `
            + get_doc_text('match-stop-genomic', 'motif occurrence')
            + get_doc_text('parse-genomic-coord', 'The latter case occurs when MCAST') + `</td> </tr>
          <tr> <td>5</td> <td>score</td> <td> ` + get_doc_text('mcast-cluster-score') + ` </td> </tr>
          <tr> <td>6</td> <td>p-value</td> <td> ` + get_doc_text('mcast-cluster-p-value') + ` </td> </tr>
          <tr> <td>7</td> <td>E-value</td> <td> ` + get_doc_text('mcast-cluster-E-value') + ` </td> </tr>
          <tr> <td>8</td> <td>q-value</td> <td> ` + get_doc_text('bh-q-value', 'MCAST') + ` 
	    <b>Note:</b> This column is empty if you used the <span class=popt>--text</span> switch.</td> </tr>
          <tr> <td>9</td> <td>sequence</td> <td>The region of the sequence matched to the motif cluster.</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'mcast-results-gff3':
      html = `
        <p>
          MCAST outputs a GFF3</a> file ('mcast.gff') that contains one line for each
          significant match to a motif cluster.
        </p>
        <p>
	  The GFF3 format is described <a href="http://gmod.org/wiki/GFF3">here</a>.
	  The 'score' reported in the MCAST GFF3 output</a> (in column 6) is<br/>
	  &nbsp;&nbsp;&nbsp;&nbsp;<code>min(1000, -10*(log10(pvalue)))</code>, <br/>
	  and the 'unique identifier' ('ID=' tag in column 9) is the value of the
	  &lt;pattern_name&gt; field in the MCAST results TSV format.  Following the
	  unique identifier in column 9, the <i>p</i>-value, <i>E</i>-value and q-value
	  of the match are given.
        </p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'tomtom-results-tsv':
      html = `
	<p>
          Tomtom outputs a tab-separated values (TSV) file ('tomtom.tsv') that contains one line for each motif
	  found to be significantly enriched.
	  The lines are grouped by query motif and sorted in order of decreasing statistical significance.
          The first line contains the (tab-separated) names of the fields.
	  Your command line is given at the end of the file in a comment line starting with the character '#'.
	</p>
	<p>
	  The names and meanings of each of the fields in <a href="` + site_url + `/doc/tomtom-output-format.html#results-tsv">Tomtom Results TSV Format</a> 
	  are described below. 
	</p>
	<table class="dark" style="width:100%" border=1>
	  <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>Query_ID</td> <td> ` + get_doc_text('motif-id', 'query') + `</td> </tr>
          <tr> <td>2</td> <td>Target_ID</td> <td> ` + get_doc_text('motif-id', 'target') + `</td> </tr>
          <tr> <td>3</td> <td>Optimal_offset</td> <td> ` + get_doc_text('tomtom-offset') + `</td> </tr>
          <tr> <td>4</td> <td>p-value</td> <td> ` + get_doc_text('tomtom-p-value') + `</td> </tr>
          <tr> <td>5</td> <td>E-value</td> <td> ` + get_doc_text('tomtom-E-value') + `</td> </tr>
          <tr> <td>6</td> <td>q-value</td> <td> ` + get_doc_text('bh-q-value', 'Tomtom') + `</td> </tr>
          <tr> <td>7</td> <td>Overlap</td> <td> ` + get_doc_text('tomtom-overlap') + `</td> </tr>
          <tr> <td>8</td> <td>Query_consensus</td> <td>A consensus sequence
                computed from the letter frequencies in the query motif
                (as described <a href="#consensus_doc">below</a>).</td> </tr>
          <tr> <td>9</td> <td>Target_consensus</td> <td>A consensus sequence
                computed from the letter frequencies in the target motif
                (as described <a href="#consensus_doc">below</a>).</td> </tr>
          <tr> <td>10</td> <td>Orientation</td> <td> ` + get_doc_text('tomtom-orientation', "<br>A value of '+' means that the target motif is as it appears in the database. A value of '-' means that the reverse complement of the target motif is shown.") + `</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    default:
      html = "Error--Unrecognized doc_type: " + doc_type;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
  }
} // print_doc

//
// Function to return the HTML text of a given type.
// This function can be used directly to document the output format (xx-output-format.html)
// and indirectly via print_doc_para for help pop-ups in the actual output HTML,
// to prevent duplication of documentation.
//
function get_doc_text(doc_type, extra) {
  var html;
  if (extra == undefined) {extra = ""};

  switch (doc_type) {

    // shared
    case 'motif-db':
      return(`
	The name of a file of motifs ("motif database file") that contains ` + extra + `
      `);
    case 'motif-id':
      return(`
	The name of the ` + extra + ` motif, which is unique in the motif database file.
      `);
    case 'motif-alt-id':
      return(`
	An alternate name for the ` + extra + ` motif, which may be provided in the motif database file.
      `);
    case 'motif-width':
      return(`
	The width of the motif. No gaps are allowed in motifs supplied to ` + extra + `
        as it only works for motifs of a fixed width.
      `);
    case 'motif-cons':
      return(`
	A consensus sequence computed from the ` + extra + ` motif (as described <a href="#consensus_doc">below</a>).
      `);
    case 'motif-match-score':
     return(`
	The score for the match of a position in a sequence to a motif is
	computed by summing the appropriate entry from each column of the
	position-dependent scoring matrix that represents the motif. ` + extra + `
     `);
    case 'motif-match-p-value':
      return(`
	The <i>p</i>-value of a motif match is the probability of a single random
	subsequence of the length of the motif
	<a href="javascript:help_refine('pop_motif_match_score')">scoring</a>
	at least as well as the observed match.
      `);
    case 'bh-q-value-method':
      return(`
        ` + extra + ` estimates q-values from all the match <i>p</i>-values 
	using the method proposed by Benjamini & Hochberg (<i>Journal of the Royal Statistical Society B</i>, 57:289-300, 1995).
	See also Storey JD, Tibshirani R. Statistical significance for
	genome-wide studies, <i>Proc. Natl. Acad. Sci. USA</i> (2003) <b>100</b>:9440&ndash;9445.
      `);
    case 'bh-q-value':
      return(`
	The minimum False Discovery Rate (FDR) required to consider this match significant.</br>` + get_doc_text('bh-q-value-method', extra) + `
      `);
    case 'sdb-name':
      return(`
	The name of the (FASTA) sequence database file.
      `);
    case 'sdb-psp':
      return(`
	The name of the position specific priors (PSP) file.
      `);
    case 'sdb-dist':
      return(`
	The name of the binned distribution of priors file.
      `);
    case 'sdb-count':
      return(`
	The number of sequences in the database.
      `);
    case 'sdb-letters':
      return(`
	The number of letters in the sequence database.
      `);
    case 'lastmod':
      return(`
	The date of the last modification to the ` + extra + ` database.
      `);
    case 'sequence-id':
      return(`
        The identifier of the sequence (from the FASTA sequence header line)` + extra + `
      `);
    case 'sequence-name':
      return(`
	` + extra + `name of the sequence extracted from the sequence identifier (in the FASTA sequence header line).<br>
	When you use the <code>--parse-genomic--coord</code> option, the sequence name ends at the
	first colon ':' (if any) present in the sequence\'s FASTA identifier.  Typically this is the
	chromosome or contig name.  With the <code>--parse-genomic--coord</code> option,
	the start and stop positions are in 0-based coordinates relative to the sequence start given 
	in the FASTA sequence identifier (just after the sequence name).</td> </tr>
      `);
    case 'sequence-desc':
      return(`
        The description appearing after the identifier of the sequence in the FASTA header line.
      `);
    case 'sequence-name':
    case 'alph-name':
      return(`
	The name of the alphabet symbol.
      `);
    case 'alph-bg':
      return(`
	The frequency of the alphabet symbol as defined by the background model.
      `);
    case 'match-start-seq':
      return(`
	The start position of the ` + extra + `; 1-based sequence coordinates.
      `);
    case 'match-stop-seq':
      return(`
	The end position of the ` + extra + `; 1-based sequence coordinates.
      `);
    case 'match-start-genomic':
      return(`
	The start position of the ` + extra + `; genomic coordinates.
      `);
    case 'match-stop-genomic':
      return(`
	The end position of the ` + extra + `; genomic coordinates.
      `);
    case 'parse-genomic-coord':
      return(`
	` + extra + ` was run with the <code>--parse-genomic-coord</code> option
	and has split the sequence identifier into sequence name, sequence start and sequence end 
	in genomic coordinates.
      `);

    // AME
    case 'ame-pvalue':
      return(`
	The optimal enrichment <i>p</i>-value of the motif according to the statistical test;
	not adjusted for multiple tests.
      `);
    case 'ame-adj-pvalue':
      return(`
	The optimal enrichment <i>p</i>-value of the motif according to the statistical test,
        adjusted for multiple tests using a Bonferroni correction. ` + extra + `
	If the best <i>p</i>-value is <i>p</i> before adjustment,
        and the number of multiple tests is <i>n</i>, then the adjusted
        <i>p</i>-value is 1 - (1-<i>p</i>)<i><sup>n</sup></i>.
      `);
    case 'ame-evalue':
      return(`
	The expected number of motifs that would be as enriched in the
        (primary) sequences as this one.  The <i>E</i>-value is the adjusted <i>p</i>-value
        multiplied by the number of motifs in the motif file(s).
      `);

    // CentriMo
    case 'centrimo-adj-pvalue':
      return(`
        The statistical significance of the enrichment of the motif, adjusted for multiple tests. ` + extra + `
      `);
    case 'centrimo-evalue':
      var evalue_html = `
        at least one region as enriched for best matches to the motif as the reported region
	(or would have optimal average distance to the sequence center as low as observed, 
	if you used the <code>--cd</code> option).
      `;
      return(`
	The expected number motifs that would have ` + (extra ? extra : evalue_html) + `
	The <i>E</i>-value is the adjusted <i>p</i>-value multiplied by the number of motifs in the
	input files(s).</td> </tr>
      `);
    case 'centrimo-bin-width':
      return(`
        The width (in sequence positions) of the most enriched region (default),
        <b>or</b> two times the average distance between the center of the best site
        and the sequence center if you used the option <code>--cd</code>.
        A best match to the motif is counted as being in the region if
        the center of the motif falls in the region.
      `);
    case 'centrimo-sites-in-bin':
      return(`
	The number of (positive) sequences whose best match to the motif `
	+ (extra ? extra : "falls in the reported region (default) or anywhere in the sequence (if you used the option <code>--cd</code>).") + `
	<br>Note: This number may be less than the number of
	(positive) sequences that have a best match in the region.
	The reason for this is that a sequence may have many matches that score
	equally best.  If <i>n</i> matches have the best score in a sequence, 1/<i>n</i> is added to the
	appropriate bin for each match.</td> </tr>
      `);
    case 'centrimo-mult-tests':
      return(`
	This is the number of multiple tests (<i>n</i>) done for this motif.
	It was used to adjust the <i>p</i>-value of a region for
	multiple tests using the formula:
	<br>&nbsp;&nbsp;
	  <i>p</i>' = 1 - (1-<i>p</i>)<sup><i>n</i></sup> where <i>p</i> is the unadjusted <i>p</i>-value.
	<br>
	The number of multiple tests is the number of regions
	considered times the number of score thresholds considered.
	It depends on the motif length, sequence length, and the type of
	optimizations being done (central enrichment, local enrichment, central distance or
	score optimization).</td> </tr>
      `);

    // GOMo
    case 'gomo-go-term':
      return(`
        The Gene Ontology Consortium term for a specific role or locality.
        Used for annotating genes with their functions.
      `);
    case 'gomo-score':
      return( `
	A score generated as the <a href="https://en.wikipedia.org/wiki/Geometric_mean">
	geometric mean</a> of <a href="https://en.wikipedia.org/wiki/Mann-Whitney_U_test">rank-sum test(s)</a> 
	for the particular Gene Ontology term. The two groups compared by the rank-sum test are scores of genes annotated 
	with the GO term and scores of genes not annotated with the GO term.</td> </tr>
      `);
    case 'gomo-p-value':
      return( `
	An empirically generated <i>p</i>-value for the enrichment of the GO term.<br>
	The null hypothesis is that by shuffling the labels on gene scores, 
	any possible association between the set of genes that a GO term annotates is destroyed. 
	A large number of scores are generated using the null hypothesis and the number of null 
	hypothesis scores that are better than each of the real scores is summed and then divided 
	by the total null hypothesis scores generated to calculate a <i>p</i>-value.</td> </tr>
      `);

    // MAST

    // MCAST
    case 'mcast-cluster-score':
      return( `
        The score that the hidden Markov model created by MCAST assigned to the motif cluster.<br>
        This is the sum of the scores of the individual motif matches in the cluster, plus a
        gap penalty, <i>g</i>, multiplied by the total size of the inter-motif gaps
        in the cluster.  Individual motif match scores are log2(<i>P(s)/p</i>), where <i>s</i> is the 
        <a href="javascript:help_refine('pop_motif_match_score')">log-odds score</a> 
        of the motif match, <i>P(s)</i> is the 
        <a href="javascript:help_refine('pop_motif_match_pvalue')"><i>p</i>-value</a> 
	of the motif match, and <i>p</i> is the user-specified <i>p</i>-value threshold (default: 0.0005).
        <div class="active" id="pop_motif_match_score_act"></div>
        <div class="active" id="pop_motif_match_pvalue_act"></div>
      `);
    case 'mcast-cluster-p-value':
      return( `
	The <i>p</i>-value of the motif cluster score.<br>
	MCAST estimates <i>p</i>-values by fitting an exponential distribution
	to the observed motif cluster scores.
      `);
    case 'mcast-cluster-E-value':
      return( `
        The <i>E</i>-value of the motif cluster score.<br>
	The <i>E</i>-value is an estimate of the <i>number</i> of false positive matches
	with <i>p</i>-values at least as good as this match\'s.  
        MCAST estimates this by multiplying the motif cluster score <i>p</i>-value
        times the (estimated) number of random matches found in the search.
      `);

    // Tomtom
    case 'tomtom-offset':
      return( `
        The offset of the query motif relative to the target motif in the optimal alignment.<br>
 	A positive value indicates the query is shifted right.
      `);
    case 'tomtom-p-value':
      return( `
        The probability that a random motif of the same width as the target would have an 
	optimal alignment with a match score as good or better than the target's.<br>
	Tomtom estimates the <i>p</i>-value using a null model consisting of sampling
	motif columns from all the columns in the set of target motifs.
      `);
    case 'tomtom-E-value':
      return( `
	The expected number of false positives in the matches up to this point.<br>
	Tomtom estimates the <i>E</i>-value by multiplying the <i>p</i>-value by
	the total number of target motifs in all the target databases.
      `);
    case 'tomtom-overlap':
      return( `
	The number of motif columns that overlap in the optimal alignment.
      `);
    case 'tomtom-orientation':
      return( `
	The orientation of the target motif that gave the optimal alignment. ` + extra + `
      `);
  }

} // get_doc_text

//
// Function to replace the innerHTML of element "id" with an HTML paragraph
// containing the text for 'doc_type', which is known to function get_doc_text.
// This function can be used in help pop-ups.
//
function print_doc_para(id, doc_type, extra) {
  html = `<p>` + get_doc_text(doc_type, extra) + `</p>`; 
  document.getElementById(id).insertAdjacentHTML('beforeend', html);
} // print_doc_para

    </script>
    <script type="text/javascript">
function make_alpha_bg_table(alph, freqs) {
  function colour_symbol(index) {
    var span = document.createElement("span");
    span.appendChild(document.createTextNode(alph.get_symbol(index)));
    span.style.color = alph.get_colour(index);
    span.className = "alpha_symbol";
    return span;
  }
  var table, thead, tbody, row, th, span, i;
  // create table
  table = document.createElement("table");
  table.className = "alpha_bg_table";
  // create header
  thead = document.createElement("thead");
  table.appendChild(thead);
  row = thead.insertRow(thead.rows.length);
  if (alph.has_complement()) {
    add_text_header_cell(row, "Name", "pop_alph_name");
    if (freqs != null) add_text_header_cell(row, "Freq.", "pop_alph_freq");
    if (alph.has_bg()) add_text_header_cell(row, "Bg.", "pop_alph_bg");
    add_text_header_cell(row, "");
    add_text_header_cell(row, "");
    add_text_header_cell(row, "");
    if (alph.has_bg()) add_text_header_cell(row, "Bg.", "pop_alph_bg");
    if (freqs != null) add_text_header_cell(row, "Freq.", "pop_alph_freq");
    add_text_header_cell(row, "Name", "pop_alph_name");
  } else {
    add_text_header_cell(row, "");
    add_text_header_cell(row, "Name", "pop_alph_name");
    if (freqs != null) add_text_header_cell(row, "Freq.", "pop_alph_freq");
    if (alph.has_bg()) add_text_header_cell(row, "Bg.", "pop_alph_bg");
  }
  // add alphabet entries
  tbody = document.createElement("tbody");
  table.appendChild(tbody);
  if (alph.has_complement()) {
    for (i = 0; i < alph.get_size_core(); i++) {
      var c = alph.get_complement(i);
      if (i > c) continue;
      row = tbody.insertRow(tbody.rows.length);
      add_text_cell(row, alph.get_name(i));
      if (freqs != null) add_text_cell(row, "" + freqs[i]);
      if (alph.has_bg()) add_text_cell(row, "" + alph.get_bg_freq(i));
      add_cell(row, colour_symbol(i)); 
      add_text_cell(row, "~");
      add_cell(row, colour_symbol(c)); 
      if (alph.has_bg()) add_text_cell(row, "" + alph.get_bg_freq(c));
      if (freqs != null) add_text_cell(row, "" + freqs[c]);
      add_text_cell(row, alph.get_name(c));
    }
  } else {
    for (i = 0; i < alph.get_size_core(); i++) {
      row = tbody.insertRow(tbody.rows.length);
      add_cell(row, colour_symbol(i)); 
      add_text_cell(row, alph.get_name(i));
      if (freqs != null) add_text_cell(row, "" + freqs[i]);
      if (alph.has_bg()) add_text_cell(row, "" + alph.get_bg_freq(i));
    }
  }
  return table;
}


    </script>
    <script type="text/javascript">
var LEGEND_LINE = 16;
var LEGEND_FONT = "Helvetica";
var LEGEND_PAD = 5;

var Dasher = function(ctx, start_x, start_y, pattern) {
  if (typeof pattern === "undefined") pattern = [];
  this.ctx = ctx;
  this.x = start_x;
  this.y = start_y;
  this.pattern = pattern;
  this.index = 0;     // where in the pattern are we up to?
  this.fragment = 0;  // how much of the current pattern have we drawn
  this.on = true;     // pen on paper?
  ctx.moveTo(start_x, start_y);
};

Dasher.prototype.dashTo = function(x, y) {
  var dx = x - this.x;
  var dy = y - this.y;
  var d = Math.pow(dx * dx + dy * dy, 0.5);
  if (this.pattern.length == 0) {
    // when no pattern is specified this just draws lines
    this.ctx.lineTo(x, y);
  } else {
    // calculate distance to complete dash
    var dc = this.pattern[this.index] - this.fragment;
    while (dc <= d) {
      // calculate the fraction of the line needed
      var f = dc / d;
      this.x += dx * f;
      this.y += dy * f;
      if (this.on) {
        this.ctx.lineTo(this.x, this.y);
      } else {
        this.ctx.moveTo(this.x, this.y);
      }
      // move to the next dash
      this.fragment = 0;
      // skip empty dashes, just toggling on state
      do {
        this.index = (this.index + 1) % this.pattern.length;
        this.on = !this.on;
      } while (this.pattern[this.index] <= 0);
      // update variables
      dc = this.pattern[this.index];
      dx = x - this.x;
      dy = y - this.y;
      d = Math.pow(dx * dx + dy * dy, 0.5);
    }
    this.fragment += d;
    this.x = x;
    this.y = y;
    if (this.on) {
      this.ctx.lineTo(this.x, this.y);
    } else {
      this.ctx.moveTo(this.x, this.y);
    }
  }
}

var CentrimoResult = function(name, sig, colour, motif_length, 
    total_sites, site_counts, neg_total_sites, neg_site_counts) {
  "use strict";
  if (typeof name === "undefined") {
    name = "";
  }
  if (typeof sig === "undefined") {
    sig = "";
  }
  if (typeof colour == "undefined") {
    colour = "#000000";
  }
  this.name = name;
  this.sig = sig;
  this.colour = colour;
  this.motif_length = motif_length;
  this.total_sites = total_sites;
  this.site_counts = site_counts;
  this.has_neg = (typeof neg_total_sites === "number" && 
      typeof neg_site_counts === "object" && neg_site_counts instanceof Array);
  this.neg_total_sites = neg_total_sites;
  this.neg_site_counts = neg_site_counts;
};

CentrimoResult.prototype.get_site_count = function (index, mirror, neg) {
  count = neg ? this.neg_site_counts[index] : this.site_counts[index];
  if (mirror) {
    i_mirror = this.site_counts.length - 1 - index;
    return (count + (neg ? this.neg_site_counts[i_mirror] : this.site_counts[i_mirror]));
  } else {
    return count;
  }
};

/*
 * CentrimoRSet
 * Construct a centrimo result set.
 */
var CentrimoRSet = function(sequence_length) {
  "use strict";
  this.sequence_length = sequence_length;
  this.results = [];
};

/*
 * seq_len
 * Get the sequence length of the result set.
 */
CentrimoRSet.prototype.seq_len = function() {
  "use strict";
  return this.sequence_length;
};

/*
 * add
 * Add a centrimo result to the set
 */
CentrimoRSet.prototype.add = function(name, sig, colour, motif_length, 
    total_sites, site_counts, neg_total_sites, neg_site_counts) {
  "use strict";
  this.results.push(new CentrimoResult(name, sig, colour, motif_length, 
    total_sites, site_counts, neg_total_sites, neg_site_counts));
};

/*
 * count
 * Return the count of centrimo results.
 */
CentrimoRSet.prototype.count = function() {
  "use strict";
  return this.results.length;
};

/*
 *  get
 *  Get an entry in the result set.
 */
CentrimoRSet.prototype.get = function(index) {
  "use strict";
  return this.results[index];
};

/*
 * CentrimoLine
 */
var CentrimoLine = function(name, sig, colour, dash, thickness, show_on_legend, xlist, ylist) {
  "use strict";
  if (xlist.length != ylist.length) {
    throw new Error("The list of x and y points must be the same length.");
  }
  this.xlist = xlist;
  this.ylist = ylist;
  this.name = name;
  this.sig = sig;
  this.colour = colour;
  this.dash = dash;
  this.thickness = thickness;
  this.show_on_legend = show_on_legend;
  this.max_prob = -1;
};

/*
 * trim
 *
 * Removes points from the ends so the lines are the same length.
 */
CentrimoLine.prototype.trim = function(left, right) {
  "use strict";
  var lefti, righti, gradient, gap, left_y, right_y;
  if (this.xlist.length == 0) return;
  if (typeof left !== "number"|| isNaN(left)) {
    throw new Error("left trim is not a number");
  }
  if (typeof right !== "number" || isNaN(right)) {
    throw new Error("right trim is not a number");
  }
  for (lefti = 0; lefti < this.xlist.length; lefti++) {
    if (this.xlist[lefti] >= left) {
      break;
    }
  }
  if (lefti === 0 && this.xlist[0] !== left) {
    throw new Error("Attempt to undertrim line on the left.");
  }
  for (righti = this.xlist.length - 1; righti >= 0; righti--) {
    if (this.xlist[righti] <= right) {
      break;
    }
  }
  if (righti === (this.xlist.length - 1) && this.xlist[righti] !== right) {
    throw new Error("Attempt to undertrim line on the right.");
  }
  if (lefti == this.xlist.length || righti == -1) {
    // all points outside of drawable region
    this.xlist = [];
    this.ylist = [];
    return;
  }
  if (this.xlist[lefti] != left) {
    // create a new point that is exactly at left by interpolating
    gradient = (this.ylist[lefti] - this.ylist[lefti-1]) / 
      (this.xlist[lefti] - this.xlist[lefti-1]);
    gap = left - this.xlist[lefti-1];
    left_y = this.ylist[lefti-1] + gradient * gap;
    this.xlist.splice(0, lefti, left);
    this.ylist.splice(0, lefti, left_y);
    righti = righti - lefti + 1;
  } else {
    this.xlist.splice(0, lefti);
    this.ylist.splice(0, lefti);
    righti -= lefti;
  }
  if (this.xlist[righti] != right) {
    // create a new point that is exactly at right by interpolating
    gradient = (this.ylist[righti + 1] - this.ylist[righti]) /
      (this.xlist[righti + 1] - this.xlist[righti]);
    gap = right - this.xlist[righti];
    right_y = this.ylist[righti] + gradient * gap;
    // truncate the lists
    this.xlist.length = righti + 1;
    this.ylist.length = righti + 1;
    // push the new item on the end of the lists
    this.xlist.push(right);
    this.ylist.push(right_y);
  } else {
    // truncate the lists
    this.xlist.length = righti + 1;
    this.ylist.length = righti + 1;
  }
  this.max_prob = -1;
};

CentrimoLine.prototype.max = function() {
  "use strict";
  var y_max, i;
  if (this.max_prob != -1) {
    return this.max_prob;
  }
  y_max = 0;
  for (i = 0; i < this.xlist.length; i++) {
    if (this.ylist[i] > y_max) {
      y_max = this.ylist[i];
    }
  }
  this.max_prop = y_max;
  return this.max_prop;
};

/*
 * CentrimoScale
 *
 * Calculates the increments on the y axis
 */
var CentrimoScale = function(max_prob) {
  "use strict";
  var decimals, inc, rounder, max, inc_plus;
  if (max_prob === 0) {
    this.max = 0.01;
    this.inc = 0.002;
    this.digits = 3;
    return;
  }
  // find the minimum number of decimals needed to display the largest
  // digit of the maximum probability
  decimals = Math.ceil(-(Math.log(max_prob) / Math.log(10)));
  // calculate an increment which is (at minimum) 10 times smaller the the max
  inc = Math.pow(10, -(decimals+1));
  // round-up the maximum probabilty to its largest digit
  rounder = Math.pow(10, decimals);
  max = Math.ceil(max_prob * rounder) / rounder;
  // adjust the increment so it's between 5 and 12 times the maximum
  // probability
  if (inc * 5 < max && inc * 12 > max) {
    inc *= 1;
  } else if (inc * 10 < max && inc * 24 > max) {
    inc *= 2;
  } else if (inc * 25 < max && inc * 60 > max) {
    inc *= 5;
  } else if (inc * 50 < max && inc * 120 > max) {
    inc *= 10;
  }
  max += inc;
  inc_plus = (1.125 * inc);
  while (max - inc_plus > max_prob) {
    max -= inc;
  }
  max = Math.min(max, 1.0);
  this.max = max;
  this.inc = inc;
  this.digits = decimals+1;
};

var CentrimoLegendMetrics = function(lw, lh, id_w, pv_w, sq_w) {
  "use strict";
  this.width = lw;
  this.height = lh;
  this.id_width = id_w;
  this.pv_width = pv_w;
  this.sq_width = sq_w;
};

var CentrimoGraphMetrics = function(legend_metrics, top_edge, bottom_edge,
    left_mark, left_val, right_mark, right_val) {
  if (typeof legend_metrics !== "object" || legend_metrics === null) {
    this.legend_width = 10;
    this.legend_height = 10;
  } else {
    this.legend_width = legend_metrics.width;
    this.legend_height = legend_metrics.height;
  }
  this.top_edge = top_edge;
  this.bottom_edge = bottom_edge;
  this.left_mark = left_mark;
  this.left_val = left_val;
  this.right_mark = right_mark;
  this.right_val = right_val;
};

/*
 * CentrimoGraph
 * Takes a results set and a window weight array and produces a graph. 
 * The weights in the window_weights should be non-negative and sum to 1.
 */
var CentrimoGraph = function(rset, window_weights, fine_text, start, end, mirror) {
  "use strict";
  var trim_left, trim_right, i, j, k, result, x, y, xpos, ypos, positions;
  var y_neg, ypos_neg, line_thickness;

  line_thickness = (window_weights.length < 10 ? 1 : 3);
  if (typeof fine_text !== "string") {
    fine_text = "";
  }
  if (typeof mirror !== "boolean") mirror = false;
  this.mirror = mirror;
  if (mirror) {
    if (typeof start === "number") {
      start = Math.max(0, start);
    } else {
      start = 0;
    }
  }
  this.fine_text = fine_text;
  this.lines = [];
  for (i = 0; i < rset.count(); i++) {
    result = rset.get(i);
    x = [];
    y = [];
    if (result.has_neg) {
      y_neg = [];
    }
    xpos = (result.motif_length - rset.seq_len() + (window_weights.length - 1)) / 2;
    if (typeof trim_left === "undefined") {
      trim_left = xpos;
    } else if (trim_left < xpos) {
      trim_left = xpos;
    }
    positions = result.site_counts.length - window_weights.length + 1;
    for (j = 0; j < positions; j++, xpos += 1) {
      ypos = 0;
      // avoid division by zero when no sites are found
      if (result.total_sites > 0) {
        for (k = 0; k < window_weights.length; k++) {
          ypos += window_weights[k] * result.get_site_count(j + k, mirror, 0);
        }
        ypos /= result.total_sites;
      }
      x.push(xpos);
      y.push(ypos);
      // handle the negative dataset
      if (result.has_neg) {
        ypos_neg = 0;
        if (result.neg_total_sites > 0) {
          for (k = 0; k < window_weights.length; k++) {
            ypos_neg += window_weights[k] * result.get_site_count(j + k, mirror, 1);
          }
          ypos_neg /= result.neg_total_sites;
        }
        y_neg.push(ypos_neg);
      }
    }
    // subtract 1 from xpos because for loop will increment it one more than needed.
    xpos -= 1;
    this.lines.push(new CentrimoLine(result.name, result.sig, result.colour, [], line_thickness, true, x, y));
    if (result.has_neg) {
      this.lines.push(new CentrimoLine(result.name, result.sig, result.colour, [6,4], 2, false, x.slice(0), y_neg));
    }
    if (positions > 0) {
      if (typeof trim_right === "undefined") {
        trim_right = xpos;
      } else if (trim_right > xpos) {
        trim_right = xpos;
      }
    }
  }
  if (typeof start !== "undefined" && start != null) {
    if (start > trim_left) {
      trim_left = start;
    }
    this.start = start;
  } else {
    this.start = -Math.ceil(rset.seq_len() / 2);
  }
  if (typeof end !== "undefined" && end != null) {
    if (end < trim_right) {
      trim_right = end;
    }
    this.end = end;
  } else {
    this.end = Math.floor(rset.seq_len() / 2);
  }
  this.max_prob = 0;
  for (i = 0; i < this.lines.length; i++) {
    this.lines[i].trim(trim_left, trim_right);
    this.max_prob = Math.max(this.max_prob, this.lines[i].max());
  }
  this.scale = new CentrimoScale(this.max_prob);
};

/*
 * draw_graph
 *
 * Draws a motif probability graph
 */
CentrimoGraph.prototype.draw_graph = function (ctx, w, h, draw_legend, legend_x, legend_y) {
  "use strict";
  var gap, l_margin, t_margin, b_margin, r_margin, legend_metrics, 
      legend_width, legend_height;
  gap = 10;
  l_margin = gap + 30 + 10 * (2 + this.scale.digits);
  t_margin = 20;
  b_margin = 60;
  r_margin = 30;
  legend_metrics = this.measure_legend(ctx);
  // setting global
  legend_width = legend_metrics.width;
  legend_height = legend_metrics.height;
  // constrain legend to within graph area
  legend_x = Math.round(legend_x);
  legend_y = Math.round(legend_y);
  if (legend_x < (l_margin + gap)) {
    legend_x = l_margin + gap;
  } else if ((legend_x + legend_metrics.width) > (w - r_margin - gap)) {
    legend_x = w - r_margin - legend_metrics.width - gap;
  }
  if (legend_y < (t_margin + gap)) {
    legend_y = t_margin + gap;
  } else if ((legend_y + legend_metrics.height) > (h - b_margin - gap)) {
    legend_y = h - b_margin - legend_metrics.height - gap;
  }

  // draw graph
  ctx.save();
  // draw border
  ctx.beginPath();
  ctx.moveTo(l_margin - 0.5, t_margin +0.5);
  ctx.lineTo(l_margin - 0.5, h - (b_margin - 0.5));
  ctx.lineTo(w - r_margin - 0.5, h - (b_margin - 0.5));
  ctx.lineTo(w - r_margin - 0.5, t_margin +0.5);
  ctx.closePath();
  ctx.stroke();
  // draw fineprint
  ctx.save();
  ctx.font = "9px Helvetica";
  ctx.textAlign = "right";
  ctx.textBaseline = "bottom";
  ctx.fillText(this.fine_text, w - 1, h - 2);
  ctx.restore();
  // draw y axis
  ctx.save();
  ctx.translate(l_margin, t_margin);
  this.draw_y_axis(ctx, 0, h - (t_margin + b_margin));
  ctx.restore();
  // draw y labels
  ctx.save();
  ctx.translate(gap, t_margin);
  this.draw_y_axis_label(ctx, l_margin, h - (t_margin + b_margin));
  ctx.restore();
  // draw x axis
  ctx.save();
  ctx.translate(l_margin, h - b_margin);
  this.draw_x_axis(ctx, w - (l_margin + r_margin), b_margin);
  ctx.restore();
  // draw top axis
  ctx.save();
  ctx.translate(l_margin, t_margin);
  this.draw_top_axis(ctx, w - (l_margin + r_margin), 0);
  ctx.restore();
  // draw x axis labels
  ctx.save();
  ctx.translate(l_margin, h - b_margin);
  this.draw_x_axis_label(ctx, w - (l_margin + r_margin), b_margin - gap);
  ctx.restore();
  // draw lines
  ctx.save();
  ctx.translate(l_margin, t_margin);
  this.draw_lines(ctx, w - (l_margin + r_margin), h - (t_margin + b_margin), 8);
  ctx.restore();
  // draw legend
  if (draw_legend) { 
    ctx.save();
    ctx.translate(legend_x, legend_y);
    this.draw_legend(ctx, legend_metrics);
    ctx.restore();
  }
  ctx.restore();
  return new CentrimoGraphMetrics(legend_metrics, t_margin, h - b_margin,
      l_margin, this.start, w - r_margin, this.end);
};

/*
 * draw_x_axis
 *
 */
CentrimoGraph.prototype.draw_x_axis = function(ctx, w, h) {
  "use strict";
  var scale_x, length, tic_inc, tic_min, tic_max, i, x;
  // pixels per unit
  scale_x = w / (this.end - this.start);
  // calculate a good tic increment
  length = this.end - this.start;
  if (length > 50) {
    // multiple of 10
    tic_inc = Math.max(1, Math.round(length / 100)) * 10;
  } else if (length > 25) {
    tic_inc = 5;
  } else if (length > 10) {
    tic_inc = 2;
  } else {
    tic_inc = 1;
  }
  // work out the min and max values within the start and end
  tic_min = Math.round(this.start / tic_inc) * tic_inc;
  if (tic_min < this.start) {
    tic_min += tic_inc;
  }
  tic_max = Math.round(this.end / tic_inc) * tic_inc;
  if (tic_max > this.end) {
    tic_max -= tic_inc;
  }
  // draw the tics
  ctx.save();
  ctx.font = "14pt Helvetica";
  ctx.textBaseline = "top";
  ctx.textAlign = "center";
  for (i = tic_min; i <= tic_max; i+= tic_inc) {
    x = Math.round((i - this.start) * scale_x) + 0.5;
    ctx.fillText(""+i, x, 5);
    if (i == this.start || i == this.end) continue;
    ctx.beginPath();
    ctx.moveTo(x, -5);
    ctx.lineTo(x, 3);
    ctx.stroke();
  }
  
  ctx.restore();
};

/*
 * draw_top_axis
 *
 */
CentrimoGraph.prototype.draw_top_axis = function(ctx, w, h) {
  "use strict";
  var scale_x, length, tic_inc, tic_min, tic_max, i, x;
  // pixels per unit
  scale_x = w / (this.end - this.start);
  // calculate a good tic increment
  length = this.end - this.start;
  if (length > 50) {
    // multiple of 10
    tic_inc = Math.max(1, Math.round(length / 100)) * 10;
  } else if (length > 25) {
    tic_inc = 5;
  } else {
    tic_inc = 1;
  }
  // work out the min and max values within the start and end
  tic_min = Math.round(this.start / tic_inc) * tic_inc;
  if (tic_min < this.start) {
    tic_min += tic_inc;
  }
  tic_max = Math.round(this.end / tic_inc) * tic_inc;
  if (tic_max > this.end) {
    tic_max -= tic_inc;
  }
  // draw the tics
  ctx.save();
  ctx.font = "14pt Helvetica";
  ctx.textBaseline = "top";
  ctx.textAlign = "center";
  for (i = tic_min; i <= tic_max; i+= tic_inc) {
    if (i == this.start || i == this.end) continue;
    x = Math.round((i - this.start) * scale_x) + 0.5;
    ctx.beginPath();
    ctx.moveTo(x, 0);
    ctx.lineTo(x, 8);
    ctx.stroke();
  }
  ctx.restore();
};

/*
 * draw_x_axis_label
 */
CentrimoGraph.prototype.draw_x_axis_label = function(ctx, w, h) {
  "use strict";
  ctx.save();
  ctx.font = "14pt Helvetica";
  ctx.textAlign = "center";
  ctx.textBaseline = "bottom";
  ctx.fillText((this.mirror ? 
        "Distance of Best Site from Sequence Center" : 
        "Position of Best Site in Sequence"), w/2, h);
  ctx.restore();
};

/*
 * draw_y_axis
 *
 * TODO some work needs to be done to allow moving the zero
 */
CentrimoGraph.prototype.draw_y_axis = function(ctx, w, h) {
  "use strict";
  var y_scale, p, y;
  ctx.save();
  ctx.font = "14pt Helvetica";
  ctx.textBaseline = "middle";
  ctx.textAlign = "right";

  y_scale = h / this.scale.max;
  for (p = 0; p < this.scale.max; p += this.scale.inc) {
    y = Math.round(h - p * y_scale) + 0.5;
    this.draw_y_tic(ctx, this.scale.digits, y, p);
  }
  this.draw_y_tic(ctx, this.scale.digits, 0.5, this.scale.max);

  ctx.restore();
};

/*
 * draw_y_tic
 */
CentrimoGraph.prototype.draw_y_tic = function(ctx, digits, y, p) {
  "use strict";
  ctx.beginPath();
  ctx.moveTo(5, y);
  ctx.lineTo(-3, y);
  ctx.stroke();
  ctx.fillText(p.toFixed(digits), -5, y);
};

/*
 * draw_y_axis_label
 */
CentrimoGraph.prototype.draw_y_axis_label = function(ctx, w, h) {
  "use strict";
  ctx.save();
  ctx.translate(0, h/2);
  ctx.rotate(-Math.PI / 2);
  ctx.font = "14pt Helvetica";
  ctx.textBaseline = "top";
  ctx.textAlign = "center";
  ctx.fillText("Probability", 0, 0);
  ctx.restore();
};

/*
 * draw_lines
 */
CentrimoGraph.prototype.draw_lines = function(ctx, w, h, tic_size) {
  "use strict";
  var scale_y, scale_x, i, line, x_points, y_points, j, x, y, dasher;
  if (typeof tic_size === "undefined") {
    tic_size = 0;
  }
  scale_y = h / this.scale.max;
  scale_x = w / (this.end - this.start);
  // draw the central line
  if (0 > this.start && 0 < this.end) {
    ctx.save();
    ctx.translate((-this.start) * scale_x, 0);
    ctx.strokeStyle = '#DDD';
    ctx.beginPath();
    ctx.moveTo(0.5, tic_size);
    ctx.lineTo(0.5, h - tic_size);
    ctx.stroke();
    ctx.restore();
  }
  // draw the lines
  ctx.save();
  ctx.lineJoin = "bevel";
  ctx.miterLimit = 0;
  for (i = 0; i < this.lines.length; i++) {
    line = this.lines[i];
    ctx.lineWidth = line.thickness;
    x_points = line.xlist;
    y_points = line.ylist;
    if (x_points.length > 1) {
      ctx.strokeStyle = line.colour;
      ctx.beginPath();
      for (j = 0; j < x_points.length; j++) {
        if (isNaN(x_points[j])) {
          throw new Error("X NaN!");
        }
        if (isNaN(y_points[j])) {
          throw new Error("Y NaN!");
        }
        x = (x_points[j] - this.start) * scale_x;
        y = h - y_points[j] * scale_y;
        if (j === 0) {
          dasher = new Dasher(ctx, x, y, line.dash);
        } else {
          dasher.dashTo(x, y);
        }
      }
      ctx.stroke();
    } else if (x_points.length == 1) {
      if (isNaN(x_points[0])) {
        throw new Error("X NaN!");
      }
      if (isNaN(y_points[0])) {
        throw new Error("Y NaN!");
      }
      x = (x_points[0] - this.start) * scale_x;
      y = h - y_points[0] * scale_y;
      ctx.fillStyle = line.colour;
      ctx.beginPath();
      ctx.arc(x, y, 2, 0, 2*Math.PI, false);
      ctx.fill();
    }
  }
  ctx.restore();
};

/*
 * measure_legend
 */
CentrimoGraph.prototype.measure_legend = function(ctx) {
  "use strict";
  var lw, lh, sq_w, id_w, pv_w, lines, i, line, len;
  // initilise the line height to the size of the padding
  lh = 2 * LEGEND_PAD;
  // calculate the column widths
  sq_w = LEGEND_LINE - 2;
  id_w = 0;
  pv_w = 0;
  ctx.save();
  ctx.font = "" + LEGEND_LINE + "px " + LEGEND_FONT; 
  for (i = 0; i < this.lines.length; i++) {
    line = this.lines[i];
    if (!line.show_on_legend) {
      continue;
    }
    lh += LEGEND_LINE * 1.2;
    len = ctx.measureText(line.name).width;
    if (id_w < len) {
      id_w = len;
    }
    len = ctx.measureText(line.sig).width;
    if (pv_w < len) {
      pv_w = len;
    }
  }
  lh = Math.round(lh);
  ctx.restore();
  // legend width is a function of the column widths
  lw = id_w + pv_w + sq_w + 4 * LEGEND_PAD;

  return new CentrimoLegendMetrics(lw, lh, id_w, pv_w, sq_w);
};

/*
 * draw_legend
 */
CentrimoGraph.prototype.draw_legend = function(ctx, metrics) {
  "use strict";
  var ln_h, pad, w, h, id_w, pv_w, sq_w, id_x, pv_x, sq_x, i, line;
  if (this.lines.length === 0) {
    return;
  }
  ln_h = LEGEND_LINE;
  pad = LEGEND_PAD;
  w = metrics.width;
  h = metrics.height;
  id_w = metrics.id_width;
  pv_w = metrics.pv_width;
  sq_w = metrics.sq_width;
  id_x = 0;
  pv_x = id_x + id_w + pad;
  sq_x = pv_x + pv_w + pad;

  ctx.save();
  ctx.font = "" + ln_h + "px " + LEGEND_FONT;
  ctx.textAlign = "left";
  ctx.textBaseline = "alphabetic";
  // draw it
  ctx.save();
  ctx.fillStyle = 'white';
  ctx.fillRect(0.5, 0.5, w-1, h-1);
  ctx.strokeStyle = 'black';
  ctx.strokeRect(0.5, 0.5, w-1, h-1);
  ctx.restore();
  ctx.translate(pad, pad);
  ctx.fillStyle = "black";
  for (i = 0; i < this.lines.length; i++) {
    line = this.lines[i];
    if (!line.show_on_legend) {
      continue;
    }
    ctx.translate(0, ln_h);
    ctx.save();
    ctx.fillStyle = line.colour;
    ctx.fillRect(sq_x, -sq_w + 0.1 * ln_h, sq_w, sq_w);
    ctx.restore();
    ctx.fillText(line.name, id_x, 0);
    ctx.fillText(line.sig, pv_x, 0);
    ctx.translate(0, 0.2 * ln_h);
  }
  ctx.restore();
};

/*
 * triangular_weights
 * Returns an array of length n containing normalized weights.
 *
 */
function triangular_weights(n) {
  "use strict";
  var weights, half, half_i, sum, i, unscaled_weight;
  weights = [];
  half = n/2;
  half_i = Math.floor(half);
  sum = 0;
  for (i = 0; i < half_i; i++) {
    unscaled_weight = (i + 0.5) / half;
    weights[i] = unscaled_weight;
    weights[n - i -1] = unscaled_weight;
    sum += 2 * unscaled_weight;
  }
  if (n % 2 == 1) {
    weights[half_i] = 1;
    sum += 1;
  }
  // normalize
  for (i = 0; i < n; i++) {
    weights[i] /= sum;
  }
  return weights;
}

/*
 * uniform_weights
 * Returns an array of length n containing normalized weights.
 *
 */
function uniform_weights(n) {
  "use strict";
  var weights, weight, i;
  weights = [];
  weight = 1.0 / n;
  for (i = 0; i < n; i++) {
    weights[i] = weight;
  }
  return weights;
}

    </script>
    <script type="text/javascript">
var centrimo_alphabet = new Alphabet(data.alphabet, data.background);
var palate = ["white", "cyan", "blue", "#FF00FF", "#00FF00", "red", "orange", "#008000", "#8A2BE2", "black"];
var text_palate = ["black", "black", "white", "white", "black", "white", "black", "white", "white", "white"];
var INT_MAX = 9007199254740992;
var default_smoothing_window = 20;

var s_motifs = [];
var s_swatches = [];
var s_logos = []
var s_count = 0;
var swap = null;
var alphabet = new Alphabet(data.alphabet, data.background);
var logo_timer = null; // timer to draw motif when the mouse pauses on a row
var logo_motif = null; // motif to draw when timer expires
var logo_row = null; // the row (or tbody) that the mouse is over
var legend_x = 1000;
var legend_y = 1000;
var union_seq_ids = [];
var intersect_seq_ids = [];
var graph_metrics = new CentrimoGraphMetrics(null, 0, 0, 0, 0, 0, 0);
var graph_click = {"start": 0, "stop": 0};
var zooms = [];

var sort_table = {
  "motif": [
    {"name": "<i>E</i>-value", "fn": sort_motif_evalue, "priority": 1, "pair": "evalue"},
    {"name": "Fisher <i>E</i>-value", "fn": sort_motif_fisherpv, "priority": 2, 
      "show": data['options']['neg_sequences'], "pair": "fisherpv"},
    {"name": "Concentration", "fn": sort_motif_concentration, "pair": "evalue"},
    {"name": "Region Position", "fn": sort_motif_position, "pair": "position"},
    {"name": "Region Distance", "fn": sort_motif_center, "pair": "center"},
    {"name": "Region Width", "fn": sort_motif_spread, "pair": "spread"},
    {"name": "Region Matches", "fn": sort_motif_sites, "pair": "sites"},
    {"name": "<i>p</i>-value (Neg Data)", "fn": sort_motif_neg_pvalue,
      "show": data['options']['neg_sequences'], "pair": "neg_pvalue"},
    {"name": "Region Matches in (Neg Data)", "fn": sort_motif_neg_sites, 
      "show": data['options']['neg_sequences'], "pair": "neg_sites"},
    {"name": "Matthew's Correlation Coefficient", "fn": sort_motif_mcc, 
      "show": data['options']['mcc'], "pair": "mcc"},
    {"name": "Sequence Matches", "fn": sort_motif_total_sites, "pair": "evalue"},
    {"name": "Max Probability", "fn": sort_motif_max_probability, "pair": "evalue"},
    {"name": "ID", "fn": sort_motif_id, "pair": "evalue"},
    {"name": "Alt ID", "fn": sort_motif_alt, "pair": "evalue"},
    {"name": "Consensus", "fn": sort_motif_consensus, "pair": "evalue"},
  ],
  "region": [
    {"id": "evalue", "name": "<i>E</i>-value", "fn": sort_peak_evalue,
      "priority": 1},
    {"id": "fisherpv", "name": "Fisher <i>E</i>-value", "fn": sort_peak_fisherpv,
      "priority": 2, "show": data['options']['neg_sequences']},
    {"id": "position", "name": "Region Position", "fn": sort_peak_position},
    {"id": "center", "name": "Region Distance", "fn": sort_peak_center},
    {"id": "spread", "name": "Region Width", "fn": sort_peak_spread},
    {"id": "sites", "name": "Region Matches", "fn": sort_peak_sites},
    {"id": "neg_pvalue", "name": "<i>p</i>-value (Neg Data)",
      "fn": sort_peak_neg_pvalue, "show": data['options']['neg_sequences']},
    {"id": "neg_sites", "name": "Region Matches in (Neg Data)",
      "fn": sort_peak_neg_sites, "show": data['options']['neg_sequences']},
    {"id": "mcc", "name": "Matthew's Correlation Coefficient",
      "fn": sort_peak_mcc, "show": data['options']['mcc']}
  ],
};

pre_load_setup();


/*
 * name_from_source
 *
 * Makes a file name more human friendly to read.
 */
function name_from_source(source) {
  "use strict";
  var file, noext;
  if (source == "-") {
    return "-"
  }
  //assume source is a file name
  file = source.replace(/^.*\/([^\/]+)$/,"$1");
  noext = file.replace(/\.[^\.]+$/, "");
  return noext.replace(/_/g, " ");
}

/*
 * get_central_probability
 *
*/
function get_central_probability() {
  var i, j;
  var windo = default_smoothing_window;
  if ($("windo"))  windo = parseInt($("windo").value);
  var half_windo = windo / 2;
  var motifs = data["motifs"];
  for (i = 0; i < motifs.length; i++) {
    var motif = motifs[i];
    var sites = motif["sites"];
    var sum = 0;
    var j1 = Math.round(-half_windo - ((motif["len"] / 2) - (data["seqlen"] / 2) + 0.5));
    var j2 = j1 + windo;
    for (j = j1; j <= j2; j++) sum += sites[j];
    motif["central_prob"] = sum / motif["total_sites"];
  }
} // get_central_probability

/*
 * pre_load_setup
 *
 *  Sets up initial variables which may be
 *  required for the HTML document creation.
 */
function pre_load_setup() {
  "use strict";
  var i, motifs, params, showlist, show, parts, db_i, id, j, motif;
  var seq_db, db, dbs, sites, max_site, max_site_pos;
  for (i = 0; i < palate.length -1; i++) {
    s_motifs[i] = null;
    s_swatches[i] = null;
    s_logos[i] = null;
  }
  s_count = 0;
  motifs = data["motifs"];
  if (data["options"]["disc"]) {
    motifs.sort(sort_motif_fisherpv);
  } else {
    motifs.sort(sort_motif_evalue);
  }
  // put a copy of the best evalue in the motif
  for (i = 0; i < motifs.length; i++) {
    motif = motifs[i];
    motif["best_log_adj_pvalue"] = motif["peaks"][0]["log_adj_pvalue"];
    // calculate the best probability
    max_site = 0;
    max_site_pos = 0;
    sites = motif["sites"];
    for (j = 0; j < sites.length; j++) {
      if (sites[j] > max_site) {
        max_site = sites[j];
        max_site_pos = j;
      }
    }
    motif["max_prob"] = max_site / motif["total_sites"];
    motif["max_prob_loc"] = max_site_pos + (motif["len"] / 2) - (data["seqlen"] / 2);
  }
  params = parse_params();
  if (params["show"]) {
    showlist = params["show"];
    for (i = 0; i < showlist.length; i++) {
      show = showlist[i];
      parts = show.match(/^db(\d+) (.+)$/);
      db_i = parseInt(parts[1]);
      id = parts[2];
      // loop over the motifs looking for a match
      for (j = 0; j < motifs.length; j++) {
        motif = motifs[j];
        if (motif["db"] == db_i && motif["id"] == id) {
          motif["colouri"] = s_count + 1;
          s_motifs[s_count] = motif;
          s_count++;
          break;
        }
      }
      // give up if we've used all the available colours
      if ((s_count + 1) >= palate.length) break; 
    }
  } else {
    s_count = Math.min(3, motifs.length);
    for (i = 0; i < s_count; i++) {
      motif = motifs[i];
      motif["colouri"] = i+1;
      s_motifs[i] = motif;
    }
  }
  calculate_seq_ids();
  // get the name of the sequence db
  seq_db = data['sequence_db'];
  if (!seq_db['name']) seq_db['name'] = name_from_source(seq_db['source']);
  // get the names of the motif databases
  dbs = data['motif_dbs'];
  for (i = 0; i < dbs.length; i++) {
    db = dbs[i];
    if (!db['name']) db['name'] = name_from_source(db['source']);
  }
}

function num_keys(e) {
  if (!e) var e = window.event;
  var code = (e.keyCode ? e.keyCode : e.which);
  var keychar = String.fromCharCode(code);
  var numre = /\d/;
  // only allow 0-9 and various control characters (Enter, backspace, delete)
  if (code != 8 && code != 9 && code != 13 && code != 46 && !numre.test(keychar)) {
    e.preventDefault();
  }
}

/*
 * toggle_column
 *
 * Adds or removes a class from the table displaying the 
 * centrally enriched motifs. This is primary used to set the visibility
 * of columns by using css rules. If the parameter 'show' is not passed
 * then the existence of the class will be toggled, otherwise it will be
 * included if show is false.
 */
function toggle_column(cls) {
  toggle_class($("motifs"), cls);
}

/*
 * toggle_filter
 *
 * Called when the user clicks a checkbox
 * to enable/disable a filter option.
 */
function toggle_filter(chkbox, filter_id) {
  var filter = $(filter_id);
  filter.disabled = !(chkbox.checked);
  if (!filter.disabled) {
    filter.focus();
    if (filter.select) filter.select();
  }
}

/*
 * enable_filter
 *
 * Called when the user clicks a filter label.
 * Enables the filter.
 */
function enable_filter(chkbox_id, filter_id) {
  var chkbox = $(chkbox_id);
  if (!chkbox.checked) {
    var filter = $(filter_id);
    $(chkbox_id).checked = true;
    filter.disabled = false;
    filter.focus();
    if (filter.select) filter.select();
  }
}

/*
 * update_filter
 *
 * If the key event is an enter key press then
 * update the filter on the CEM table
 */
function update_filter(e) {
  if (!e) var e = window.event;
  var code = (e.keyCode ? e.keyCode : e.which);
  if (code == 13) {
    e.preventDefault();
    make_CEM_table();
  }
}

/*
 * toggle_lock
 *
 */

/*
 * clear_selection
 *
 * Called when the user clicks the X in the
 * title of the centrally enriched motifs and
 * causes all the motifs to be deselected.
 */
function clear_selection() {
  for (var i = 1; i < palate.length; i++) {
    var motif = s_motifs[i-1];
    var swatch = s_swatches[i-1];
    s_motifs[i-1] = null;
    s_swatches[i-1] = null;
    s_logos[i-1] = null;
    if (motif) delete motif['colouri'];
    if (swatch) swatch.style.backgroundColor = palate[0];
  }
  s_count = 0;
  if (!data['options']['noseq']) {
    //reset_sequences_IDs_list();
    union_seq_ids = [];
    intersect_seq_ids = [];
    display_seq_ids();
  }
  make_PM_table();
  make_MP_graph();
}

/*
 * toggle_graph_motif
 *
 * Activated when the user clicks on a swatch in the centrally enriched motifs 
 * table. If the motif is already selected it deselects it otherwise it picks 
 * an unused colour and selects it for graphing.
 */
function toggle_graph_motif(e) {
  "use strict";
  var swatch;
  if (!e) var e = window.event;
  if (e.target) swatch = e.target;
  else if (e.srcElement) swatch = e.srcElement;
  // in case we land on a text node
  if (swatch.nodeType == 3) swatch = swatch.parentNode;
  // find the containing tbody
  var group = find_parent(swatch.parentNode, "peak_group");
  // get the attached motif
  var motif = group['data_motif'];
  if (motif['colouri'] && motif['colouri'] != 0) {
    // deselect the motif
    var i = motif['colouri'];
    s_motifs[i-1] = null;
    s_swatches[i-1] = null;
    s_logos[i-1] = null;
    delete motif['colouri'];
    swatch.style.backgroundColor = palate[0];
    s_count--;
    if (!data['options']['noseq']) calculate_seq_ids();
  } else {
    // select an unused colour
    var i;
    for (i = 1; i < palate.length; i++) {
      if (!s_motifs[i-1]) break;
    }
    if (i == palate.length) {
      alert("All graph colours used. Please deselect motifs before adding more.");
      return;
    }
    s_motifs[i-1] = motif;
    s_swatches[i-1] = swatch;
    motif['colouri'] = i;
    swatch.style.backgroundColor = palate[i];
    s_count++;
    if (!data['options']['noseq']) {
      if (s_count == 1) {
        union_seq_ids = motif["seqs"].slice(0);
        intersect_seq_ids = union_seq_ids.slice(0);
      } else {
        union_seq_ids = union_nums(union_seq_ids, motif["seqs"]);
        intersect_nums(intersect_seq_ids, motif["seqs"]);
      }
    }
  }
  if (!data['options']['noseq']) display_seq_ids();
  make_PM_table();
  make_MP_graph();
}

/*
 * move_legend
 *
 * Called when the user clicks on the graph
 * to move the legend location.
 */
function move_legend(e) {
  var target;
  if (!e) var e = window.event;
  if (e.target) target = e.target;
  else if (e.srcElement) target = e.srcElement;
  var elemXY = coords(target);
  var posx = 0;
  var posy = 0;
  if (e.pageX || e.pageY)   {
    posx = e.pageX;
    posy = e.pageY;
  }
  else if (e.clientX || e.clientY)   {
    posx = e.clientX + document.body.scrollLeft
      + document.documentElement.scrollLeft;
    posy = e.clientY + document.body.scrollTop
      + document.documentElement.scrollTop;
  }
  var x = posx - elemXY[0];
  var y = posy - elemXY[1];
  legend_x = x - graph_metrics.legend_width/2;
  legend_y = y - graph_metrics.legend_height/2;
  if (parseInt($("legend").value) != 0) make_MP_graph();
}

function highlight_peak(e) {
  var target, pop;
  pop = $("pop_peak");
  if (pop.style.visibility === "visible") return;
  if (!e) var e = window.event;
  if (e.target) target = e.target;
  else if (e.srcElement) target = e.srcElement;
  while (!target['data_peak']) {
    if (target.nodeName == 'BODY') return;
    target = target.parentNode;
  }
  var peak = target['data_peak'];

  var l = graph_metrics.left_mark;
  var w = graph_metrics.right_mark - graph_metrics.left_mark;
  var d = graph_metrics.right_val - graph_metrics.left_val;
  var unit = w / d;

  var peak_width = peak["spread"];
  var peak_left = peak["center"] - (peak["spread"] / 2);
  var peak_offscreen = 0;
  if (peak_left < graph_metrics.left_val) {
    peak_offscreen = graph_metrics.left_val - peak_left;
    peak_width = Math.max(0, peak_width - peak_offscreen);
    peak_left = graph_metrics.left_val;
  } else if ((peak_left + peak_width) > graph_metrics.right_val) {
    peak_offscreen = (peak_left + peak_width) - graph_metrics.right_val;
    peak_width = Math.max(0, peak_width - peak_offscreen);
    peak_left = Math.min(peak_left, graph_metrics.right_val);
  }
  
  if (peak_width > 0) {
    pop.style.width = (peak_width * unit) + "px";
    pop.style.left = (l + ((peak_left - graph_metrics.left_val) * unit)) + "px";
    pop.style.visibility = "visible";
  }
}

function dehighlight_peak(e) {
  $("pop_peak").style.visibility = "hidden";
}

/*
 * hover_logo
 *
 * Activated when the user hovers their cursor over a row in the centrally 
 * enriched motifs table. After a fifth of a second delay, displays a box with 
 * the logo and reverse complement logo.
 */
function hover_logo(e) {
  var popup;
  if (this === logo_row) return;
  logo_row = this;
  if (logo_timer) clearTimeout(logo_timer);
  logo_row.addEventListener('mousemove', move_logo, false);
  popup = $("logo_popup");
  if (popup["data_motif"] != logo_row["data_motif"]) {
    logo_timer = setTimeout(popup_logo, 200);
  } else {
    popup.style.display = "block";
  }
}

/*
 * dehover_logo
 *
 * Activated when the user moves their cursor off a row in the centrally 
 * enriched motifs table. Hides the logo box (or stops it from being displayed).
 */
function dehover_logo(e) {
  var popup = $("logo_popup");
  popup.style.display = "none";
  if (logo_timer) clearTimeout(logo_timer);
  if (logo_row) logo_row.removeEventListener('mousemove', move_logo, false);
  logo_row = null;
  logo_timer = null;
}

/*
 * move_logo
 * 
 * keeps the motif logo at a set distance from the cursor.
 */
function move_logo(e) {
  var popup = $("logo_popup");
  popup.style.left = (e.pageX + 20) + "px";
  popup.style.top = (e.pageY + 20) + "px";
}

/*
 * popup_logo
 *
 * Activated when the user has had the cursor over a row in the centrally 
 * enriched motifs table for longer than 1/5th of a second. It draws the
 * motif logos in a popup and displays the popup.
 */
function popup_logo() {
  if (logo_row == null) return;
  var motif = logo_row["data_motif"];
  var pspm = new Pspm(motif['pwm'], motif['id'], 0, 0, 
      motif['motif_nsites'], motif['motif_evalue']);
  var canvas = $("logo_popup_canvas");
  var logo = logo_1(alphabet, "", pspm);
  draw_logo_on_canvas(logo, canvas, false, 0.5);
  if (!data["options"]["norc"]) {
    // draw RC motif
    var canvas_rc = $("logo_popup_canvas_rc");
    var pspm_rc = pspm.copy().reverse_complement(alphabet);
    var logo_rc = logo_1(alphabet, "", pspm_rc);
    draw_logo_on_canvas(logo_rc, canvas_rc, false, 0.5);
  }

  var popup = $("logo_popup");
  popup.style.display = "block";
  popup['data_motif'] = motif;
  logo_timer = null;
}

/*
 * swap_colour
 *
 * Activated when the user clicks a swatch in the plotted motifs table.
 * If a swatch has already been selected then swap colours with this one,
 * otherwise record which swatch has been selected.
 */
function swap_colour(e) {
  var swatch;
  if (!e) var e = window.event;
  if (e.target) swatch = e.target;
  else if (e.srcElement) swatch = e.srcElement;
  var row = swatch;
  while (!row['motif']) row = row.parentNode;
  var motif = row['motif'];
  if (swap == null) {
    swatch.appendChild(document.createTextNode("\u21c5"));
    swap = motif;
  } else if (swap == motif) {
    while (swatch.firstChild) swatch.removeChild(swatch.firstChild);
    swap = null;
  } else {
    var swapi = swap['colouri'];
    var motifi = motif['colouri'];
    motif['colouri'] = swapi;
    swap['colouri'] = motifi;
    // swap swatches
    var temp = s_swatches[swapi-1];
    s_swatches[swapi-1] = s_swatches[motifi-1];
    s_swatches[motifi-1] = temp;
    // swap motifs
    temp = s_motifs[swapi-1];
    s_motifs[swapi-1] = s_motifs[motifi-1];
    s_motifs[motifi-1] = temp;
    // swap logos
    temp = s_logos[swapi-1];
    s_logos[swapi-1] = s_logos[motifi-1];
    s_logos[motifi-1] = temp;
    // update swatch colours
    s_swatches[swapi-1].style.backgroundColor = palate[swapi];
    s_swatches[motifi-1].style.backgroundColor = palate[motifi];
    swap = null;
    make_PM_table();
    make_MP_graph();
  }
}

/*
 * set_colour
 *
 * Activated when the user clicks a swatch in the unused colours section.
 * If a swatch has already been selected then set its colour to this one,
 * otherwise warn the user that they must select a motif swatch first.
 */
function set_colour(e) {
  var swatch;
  if (!e) var e = window.event;
  if (e.target) swatch = e.target;
  else if (e.srcElement) swatch = e.srcElement;
  var colouri = swatch['colouri'];
  if (swap) {
    var swapi = swap['colouri'];
    swap['colouri'] = colouri;
    s_swatches[colouri-1] = s_swatches[swapi-1];
    s_motifs[colouri-1] = s_motifs[swapi-1];
    s_logos[colouri-1] = s_logos[swapi-1];
    s_swatches[swapi-1] = null;
    s_motifs[swapi-1] = null;
    s_logos[swapi-1] = null;
    s_swatches[colouri-1].style.backgroundColor = palate[colouri];
    swap = null;
    make_PM_table();
    make_MP_graph();
  } else {
    alert("You must select a motif to set to this colour first.");
  }
}

/*
 * page_loaded
 *
 * Called when the page has loaded for the first time.
 */
function page_loaded() {
  first_load_setup();
  post_load_setup();
}

/*
 * page_loaded
 *
 * Called when a cached page is reshown.
 */
function page_shown(e) {
  if (e.persisted) post_load_setup();
}

/*
 * union_nums
 *
 * Returns a union of two sorted lists of numbers.
 */
function union_nums(list1, list2) {
  "use strict";
  var i, j, list_out;
  i = j = 0;
  list_out = [];
  while (i < list1.length && j < list2.length) {
    if (list1[i] < list2[j]) {
      list_out.push(list1[i]);
      i++;
    } else if (list1[i] === list2[j]) {
      list_out.push(list1[i]);
      i++;
      j++;
    } else { // list1[i] > list2[j]
      list_out.push(list2[j]);
      j++;
    }
  }
  if (i < list1.length) {
    for (; i < list1.length; i++) {
      list_out.push(list1[i]);
    }
  } else {
    for (; j < list2.length; j++) {
      list_out.push(list2[j]);
    }
  }
  return list_out;
}

/*
 * intersect_nums
 *
 * Removes numbers from the target_list which do not also appear in the
 * incoming_list. Both lists must be sorted.
 */
function intersect_nums(target_list, incoming_list) {
  "use strict";
  var i, j, shift;
  shift = i = j = 0;
  while (i < target_list.length && j < incoming_list.length) {
    if (target_list[i] > incoming_list[j]) {
      j++;
    } else if (target_list[i] < incoming_list[j]) {
      i++;
      shift++;
    } else {
      if (shift > 0) target_list[i - shift] = target_list[i];
      i++;
      j++;
    }
  }
  target_list.length = i - shift;
}

function calculate_seq_ids() {
  var i, motif;
  // calculate sequence id sets
  if (!data['options']['noseq']) {
    if (s_count == 0) {
      union_seq_ids = [];
      intersect_seq_ids = [];
    } else {
      for (i = 0; i < s_motifs.length; i++) {
        motif = s_motifs[i];
        if (motif) {
          union_seq_ids = motif["seqs"].slice(0);
          intersect_seq_ids = union_seq_ids.slice(0);
          break;
        }
      }
      for (; i < s_motifs.length; i++) {
        motif = s_motifs[i];
        if (motif === null) continue;
        union_seq_ids = union_nums(union_seq_ids, motif["seqs"]);
        intersect_nums(intersect_seq_ids, motif["seqs"]);
      }
    }
  }
}

function display_seq_ids() {
  var u_n_cont, u_p_cont, i_n_cont, i_p_cont, i_s_cont;
  var union_count, intersect_count, total_count;
  var union_percent, intersect_percent, intersect_seqs, i;
  var sequences;
  sequences = data["sequences"];
  union_count = union_seq_ids.length;
  intersect_count = intersect_seq_ids.length;
  total_count = sequences.length;
  union_percent = Math.round((union_count / total_count) * 100);
  intersect_percent = Math.round((intersect_count / total_count) * 100);
  u_n_cont = $('matching_union_number');
  u_p_cont = $('matching_union_percentage');
  i_n_cont = $('matching_intersection_number');
  i_p_cont = $('matching_intersection_percentage');
  i_s_cont = $('matching_intersection_sequences');
  u_n_cont.innerHTML = "";
  u_n_cont.appendChild(document.createTextNode(union_count));
  u_p_cont.innerHTML = "";
  u_p_cont.appendChild(document.createTextNode(union_percent));
  i_n_cont.innerHTML = "";
  i_n_cont.appendChild(document.createTextNode(intersect_count));
  i_p_cont.innerHTML = "";
  i_p_cont.appendChild(document.createTextNode(intersect_percent));
  intersect_seqs = [];
  for (i = 0; i < intersect_count; i++) {
    intersect_seqs.push(sequences[intersect_seq_ids[i]]);
  }
  i_s_cont.value = intersect_seqs.join("\n");
}

/*
 * find_highest_peaks
 *
 * Locate highest peaks for every motif.
 * Compute every x position and keep the highest one.
 */
/*
function find_highest_peaks(smoothing_type) {
  var sequence_length=data['seqlen'];
  var windo=parseInt($("windo").value);
  var half_window = windo / 2;
  var weights = [];
  var tbl = $("motifs");
  var tbody = tbl.tBodies[0];
  if (smoothing_type==1) { // Only computed for weighted moving average
    var total_weight = 0;
    for (var i = 0; i < windo; i++) {
      var pos = i + 0.5;
      var weight = (pos < half_window ? pos / half_window : (windo - pos) / half_window);
      weights.push(weight);
      total_weight += weight;
    }
  }
  for (var i = 0; i < data['motifs'].length; i++) { // For each motif
    var motif = data['motifs'][i];
    var sites = motif['sites'];
    var max_prob=-1;
    var index_max_prob=-1;
    var xpos = (motif.len / 2) - (sequence_length / 2) + half_window;
    var end = sites.length - windo;
    for (var j = 0; j < end; j++, xpos += 1) {
      var sum = 0;
      for (var k = 0; k < windo; k++) {
        sum += (smoothing_type==1) ? sites[j + k] * weights[k] : sites[j + k];
      }
      var avg = (smoothing_type==1) ? sum / total_weight : sum / windo;
      var prob = avg / motif['total_sites'];
      if (prob>max_prob) { // If Y axis value is higher than saved one
        max_prob=prob; // Save it
        index_max_prob=Math.floor(xpos); // Save the location
      }
    }
    motif["highest_peak"]=index_max_prob; // Save highest peak location for this motif
  }
}*/

/*
 * first_load_setup
 *
 * Setup state that is dependent on everything having been loaded already.
 * On browsers which cache state this is only run once.
 */
function first_load_setup() {
  if (data['options']['noseq']) {
    // no sequence ids to display
    $('seq_area').style.display='none';
  }
  if (!data['options']['local']) {
    // bins are centered, there is only one peak
    $('show_blocation').checked = false;
    $('CB_show_blocation').style.display='none';
    $('box_peak_sort').style.display = 'none';
    toggle_class($('motifs'), 'hide_OEbins', true);
  }
  if (!data['options']['neg_sequences']) {
    $('show_fisherpv').checked = false;
    $('show_negtsites').checked = false;
    $('show_negbsites').checked = false;
    $('show_negative_binomial').checked = false;
    // no negative sites, so hide negative bin sites and total
    $('CB_show_plot_negative').style.display= 'none';
    $('plot_negative').value = 0;
    $('CB_show_negbsites').style.display= 'none';
    $('CB_show_negtsites').style.display= 'none';
    $('CB_show_negative_binomial').style.display='none';
    $('CB_filter_on_negbintest').style.display='none';
    $('cb_show_fisherpv').style.display = 'none';
    $('cb_filter_on_fisherpv').style.display = 'none';
  }
  if (!data['options']['disc']) {
    // negative data set was not used with a discriminative search
    $('cb_show_fisherpv').style.display = 'none';
  }
  if (!data['options']['mcc']) {
    $('CB_show_MCC').style.display='none';
  }
  if (!data['options']['optimize_score']) {
    // per motif score optimisation turned off, so hide column
    $('show_score').checked = false;
  }
  if (data['options']['dist']) {
    // distance-to-center objective so hide Region Matches and show total matches.
    $('show_bsites').checked = false;
    $('show_tsites').checked = true;
  }
}

/*
 * post_load_setup
 *
 * Setup state that is dependent on everything having been loaded already.
 */
function post_load_setup() {
  "use strict";
  var tbl, i;
  if (data["options"]["norc"]) $("logo_popup_canvas_rc").style.display = "none";
  $("filter_id").disabled = !($("filter_on_id").checked);
  $("filter_alt").disabled = !($("filter_on_alt").checked);
  $("filter_evalue").disabled = !($("filter_on_evalue").checked);
  $("filter_binwidth").disabled = !($("filter_on_binwidth").checked);
  $("filter_negbintest").disabled = !($("filter_on_negbintest").checked);
  tbl = $("motifs");
  toggle_class(tbl, "hide_db", !$("show_db").checked);
  toggle_class(tbl, "hide_id", !$("show_id").checked);
  toggle_class(tbl, "hide_name", !$("show_name").checked);
  toggle_class(tbl, "hide_consensus", !$("show_consensus").checked);
  toggle_class(tbl, "hide_fisherpv", !$("show_fisherpv").checked);
  toggle_class(tbl, "hide_evalue", !$("show_evalue").checked);
  toggle_class(tbl, "hide_pvalue", !$("show_pvalue").checked);
  toggle_class(tbl, "hide_MCC", !$("show_MCC").checked);
  toggle_class(tbl, "hide_blocation", !$("show_blocation").checked);
  toggle_class(tbl, "hide_bwidth", !$("show_bwidth").checked);
  toggle_class(tbl, "hide_bsites", !$("show_bsites").checked);
  toggle_class(tbl, "hide_tsites", !$("show_tsites").checked);
  toggle_class(tbl, "hide_negbsites", !$("show_negbsites").checked);
  toggle_class(tbl, "hide_negtsites", !$("show_negtsites").checked);
  toggle_class(tbl, "hide_negative_binomial", !$("show_negative_binomial").checked);
  toggle_class(tbl, "hide_maxprob", !$("show_maxprob").checked);
  toggle_class(tbl, "hide_hpeak", !$("show_hpeak").checked); //max prob location
  toggle_class(tbl, "hide_nbinstested", !$("show_nbinstested").checked);
  toggle_class(tbl, "hide_score", !$("show_score").checked);
  get_central_probability();
  make_PM_table();
  make_CEM_table();
  make_MP_graph();
  add_MP_graph_listeners();
  if (!data['options']['noseq']) display_seq_ids();
}

/*
 *  sort_motif_id
 *
 *  Takes 2 motif objects and compares them based on id and database.
 */
function sort_motif_id(m1, m2) {
  var diff;
  diff = m1['id'].localeCompare(m2['id']);
  if (diff == 0) {
    diff = m1['db'] - m2['db'];
  }
  return diff;
}

/*
 * sort_motif_alt
 *
 * Takes 2 motif objects and compares them based on alternate id.
 */
function sort_motif_alt(m1, m2) {
  var diff;
  if (m1['alt'] && m2['alt']) {
    diff = m1['alt'].localeCompare(m2['alt']);
    if (diff != 0) return diff;
    return sort_motif_evalue(m1, m2);
  } else {
    if (m1['alt']) {
      return -1;
    } else {
      return 1;
    }
  }
}

/*
 * sort_motif_consensus
 *
 * Takes 2 motif objects and compares them based on consensus.
 */
function sort_motif_consensus(m1, m2) {
  var diff;
  if (m1['consensus'] && m2['consensus']) {
    diff = m1['consensus'].localeCompare(m2['consensus']);
    if (diff != 0) return diff;
    return sort_motif_evalue(m1, m2);
  } else {
    if (m1['consensus']) {
      return -1;
    } else {
      return 1;
    }
  }
}

/*
 * sort_motif_fisherpv
 *
 * Takes 2 motif objects and compares them based on the Fisher pvalue
 */
function sort_motif_fisherpv(m1, m2) {
  var diff, p1, p2;
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = p1['fisher_log_adj_pvalue'] - p2['fisher_log_adj_pvalue'];
  if (diff != 0) return diff;
  diff = p2['pos_sites'] - p1['pos_sites'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

function sort_motif_neg_pvalue(m1, m2) {
  var diff, p1, p2;
  //return sort_motif_evalue(m1, m2);
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = p1['neg_log_adj_pvalue'] - p2['neg_log_adj_pvalue'];
  if (diff != 0) return diff;
  diff = p2['neg_sites'] - p1['neg_sites'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

function sort_motif_neg_sites(m1, m2) {
  var diff, p1, p2;
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = p1['neg_sites'] - p2['neg_sites'];
  if (diff != 0) return diff;
  diff = p1['neg_log_adj_pvalue'] - p2['neg_log_adj_pvalue'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

/*
 * sort_motif_evalue
 *
 * Takes 2 motif objects and compares them based on the log_adj_pvalue.
 */
function sort_motif_evalue(m1, m2) {
  var diff, p1, p2;
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = p1['log_adj_pvalue'] - p2['log_adj_pvalue'];
  if (diff != 0) return diff;
  diff = p1['spread'] - p2['spread'];
  if (diff != 0) return diff;
  return sort_motif_id(m1, m2);
}

/*
 * sort_motif_spread
 *
 * Takes 2 motif objects and compares them based on the bin_width.
 */
function sort_motif_spread(m1, m2) {
  var diff, p2, p2;
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = p1['spread'] - p2['spread'];
  if (diff != 0) return diff;
  diff = p1['log_adj_pvalue'] - p2['log_adj_pvalue'];
  if (diff != 0) return diff;
  return sort_motif_id(m1, m2);
}

/*
 * sort_central_probability
 *
 * Takes 2 motif objects and compares them based on the concentration
 * of sites in the central region of width equal to the smoothing
 * window width.
 */
function sort_motif_concentration(m1, m2) {
  var diff;
  diff = m2['central_prob'] - m1['central_prob'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

/*
 * sort_motif_max_probability
 *
 * Takes 2 motif objects and compares them based on the maximum probability.
 */
function sort_motif_max_probability(m1, m2) {
  var diff;
  diff = m2['max_prob'] - m1['max_prob'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

/*
 * sort_motif_sites
 *
 * Takes 2 motif objects and compares them based on the bin sites.
 */
function sort_motif_sites(m1, m2) {
  var diff, p1, p2;
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = p2['sites'] - p1['sites'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

/*
 * sort_motif_center
 *
 * Takes 2 motif objects and compares them based on the abs(bin location).
 */
function sort_motif_center(m1, m2) {
  var diff, p1, p2;
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = Math.abs(p1['center']) - Math.abs(p2['center']);
  if (diff != 0) return diff;
  diff = p1['center'] - p2['center'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

/*
 * sort_motif_position
 *
 * Takes 2 motif objects and compares them based on the bin location.
 */
function sort_motif_position(m1, m2) {
  var diff, p1, p2;
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = p1['center'] - p2['center'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

/*
 * sort_motif_mcc
 *
 * Takes 2 motif objects and compares them based on the Matthews Correlation Coefficient.
 */
function sort_motif_mcc(m1, m2) {
  var diff, p1, p2;
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = p2['mcc'] - p1['mcc'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

/*
 * sort_motif_total_sites
 *
 * Takes 2 motif objects and compares them based on the total sites.
 */
function sort_motif_total_sites(m1, m2) {
  var diff;
  diff = m2['total_sites'] - m1['total_sites'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}


/*
 * get_sort_cmp
 *
 * Gets the sorting comparator by index.
 *
 */
function motif_sort_cmp(index) {
  "use strict";
  if (index > 0 && index < sort_table["motif"].length) {
    return sort_table["motif"][index]["fn"];
  }
  return sort_motif_evalue;
}

/*
 * sort_peak_fisherpv
 *
 * Takes 2 peak objects and compares them based on the Fisher pvalue
 */
function sort_peak_fisherpv(p1, p2) {
  var diff;
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  diff = p1['fisher_log_adj_pvalue'] - p2['fisher_log_adj_pvalue'];
  if (diff != 0) return diff;
  diff = p2['pos_sites'] - p1['pos_sites'];
  if (diff != 0) return diff;
  return sort_peak_evalue(p1, p2);
}

function sort_peak_evalue(p1, p2) {
  var diff;
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  diff = p1['log_adj_pvalue'] - p2['log_adj_pvalue'];
  if (diff != 0) return diff;
  diff = p1['spread'] - p2['spread'];
  if (diff != 0) return diff;
  return p1['center'] - p2['center']; 
}

function sort_peak_mcc(p1, p2) {
  var diff;
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  diff = p2['mcc'] - p1['mcc'];
  if (diff != 0) return diff;
  return sort_peak_evalue(p1, p2);
}

function sort_peak_center(p1, p2) {
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  diff = Math.abs(p1['center']) - Math.abs(p2['center']); 
  if (diff != 0) return diff;
  return p1['center'] - p2['center']; 
}

function sort_peak_position(p1, p2) {
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  return p1['center'] - p2['center']; 
}

function sort_peak_spread(p1, p2) {
  var diff;
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  diff = p1['spread'] - p2['spread'];
  if (diff != 0) return diff;
  diff = p1['log_adj_pvalue'] - p2['log_adj_pvalue'];
  if (diff != 0) return diff;
  return p1['center'] - p2['center']; 
}

function sort_peak_sites(p1, p2) {
  var diff;
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  diff = p2['sites'] - p1['sites'];
  if (diff != 0) return diff;
  return sort_peak_evalue(p1, p2);
}

function sort_peak_neg_pvalue(p1, p2) {
  var diff;
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  diff = p1['neg_log_adj_pvalue'] - p2['neg_log_adj_pvalue'];
  if (diff != 0) return diff;
  diff = p2['neg_sites'] - p1['neg_sites'];
  if (diff != 0) return diff;
  return sort_peak_evalue(p1, p2);
}

function sort_peak_neg_sites(p1, p2) {
  var diff;
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  diff = p1['neg_sites'] - p2['neg_sites'];
  if (diff != 0) return diff;
  diff = p1['neg_log_adj_pvalue'] - p2['neg_log_adj_pvalue'];
  if (diff != 0) return diff;
  return sort_peak_evalue(p1, p2);
}

function peak_sort_cmp(index) {
  "use strict";
  if (index > 0 && index < sort_table["region"].length) {
    return sort_table["region"][index]["fn"];
  }
  return sort_peak_evalue;
}

/*
 * log2str
 *
 * Converts a log value into scientific notation.
 */
function log2str(log_val, precision, max) {
  var log10_val, e, m;
  if (log_val < 0) {
    log10_val = log_val / Math.log(10);
    e = Math.floor(log10_val);
    m = Math.pow(10, log10_val - e);
    if (m + (0.5 * Math.pow(10, -precision)) >= 10) {
      m = 1;
      e += 1;
    }
    return "" + m.toFixed(precision) + "e" + e;
  } else if (typeof max !== "number" || Math.exp(log_val) < max) {
    return Math.exp(log_val).toFixed(precision);
  } else {
    return ">"+max;
  }
}

/*
 * str2log
 *
 * Converts a scientific notation number string to a log value.
 */
function str2log(str, default_value) {
  var sci_num_re, parts, m, e, log_num;
  if (typeof default_value === "undefined") {
    default_value = null;
  }
  sci_num_re = /^([+]?\d+(?:\.\d+)?)(?:[eE]([+-]\d+))?$/;
  parts = sci_num_re.exec(str);
  if (parts && parseFloat(parts[1]) != 0) {
    m = parseFloat(parts[1]);
    if (m === 0) return default_value;
    e = (parts.length == 3 && parts[2] != null ? parseInt(parts[2]) : 0);
    log_num = (((Math.log(m)/Math.log(10)) + e) * Math.log(10));
    return log_num;
  } else {
    return default_value;
  }
}

/*
 * pvstr
 *
 * Gets the p-value of the motif in string form.
 */
function pvstr(peak) {
  return log2str(peak['log_adj_pvalue'], 1);
}

/*
 * evstr
 *
 * Gets the E-value of the motif in string form.
 */
function evstr(peak, type) {
  return log2str(peak[type] + Math.log(data['tested']), 1);
}

/*
 * make_swatch
 *
 * Make a swatch block.
 */
function make_swatch(colouri) {
  var swatch = document.createElement('div');
  swatch.className = 'swatch';
  swatch.style.backgroundColor = palate[colouri];
  swatch.style.color = text_palate[colouri];
  return swatch;
}

function make_CEM_main_row(tbody, motif) {
  "use strict";
  var colouri, row, swatch, peak, expander;
  peak = motif['peaks'][0];
  colouri = motif['colouri'];
  if (!colouri) colouri = 0;
  row = tbody.insertRow(tbody.rows.length);
  row['data_peak'] = peak;
  swatch = make_swatch(colouri);
  swatch.onclick = toggle_graph_motif;
  if (colouri != 0) {
    s_swatches[colouri -1] = swatch;
  }
  add_cell(row, swatch);
  add_text_cell(row, motif_dbs[motif['db']]['name'], 'col_db');
  add_cell(row, make_link(motif['id'], motif['url']), 'col_id');
  add_text_cell(row, motif['alt'], "col_name");
  add_text_cell(row, motif['consensus'], "col_consensus");
  add_text_cell(row, motif["central_prob"].toFixed(4), "col_centralprob");
  add_text_cell(row, evstr(peak, 'log_adj_pvalue'), 'col_evalue');
  if (data['options']['neg_sequences']) {
    add_text_cell(row, evstr(peak, 'fisher_log_adj_pvalue'), "col_fisherpv");
  }
  add_text_cell(row, pvstr(peak), 'col_pvalue');
  if (data['options']['neg_sequences']) {
    add_text_cell(row, log2str(peak['neg_log_adj_pvalue'],1), "col_negative_binomial");
  } else {
    add_text_cell(row, '', "col_negative_binomial");
  }
  if (data['options']['mcc']) {
    add_text_cell(row, peak['mcc'].toFixed(3), "col_MCC");
  } else {
    add_text_cell(row, '', "col_MCC");
  }
  add_text_cell(row, peak['center'], "col_blocation");
  add_text_cell(row, peak['spread'], 'col_bwidth');
  add_text_cell(row, Math.round(peak['sites']), "col_bsites");
  add_text_cell(row, motif['total_sites'], "col_tsites");
  if (data['options']['neg_sequences']) {
    add_text_cell(row, Math.round(peak['neg_sites']), "col_negbsites");
    add_text_cell(row, motif['neg_total_sites'], "col_negtsites");
  } else {
    add_text_cell(row, '', "col_negbsites")
    add_text_cell(row, '', "col_negtsites");
  }
  add_text_cell(row, motif["max_prob"].toFixed(4), "col_maxprob");
  add_text_cell(row, motif["max_prob_loc"], "col_problocation");
  add_text_cell(row, motif['n_tested'], "col_nbinstested");
  add_text_cell(row, motif['score_threshold'].toExponential(2), "col_score");
  if (motif['peaks'].length > 1) {
    expander = document.createElement('span');
    expander.appendChild(document.createTextNode("\u21A7"));
    expander.className = "expander";
    expander.addEventListener("click", toggle_peaks, false);
    add_cell(row, expander, "col_OEbins");
  } else {
    add_text_cell(row, '-', "col_OEbins");
  }
  row.addEventListener('mouseover', highlight_peak, false);
  row.addEventListener('mouseout', dehighlight_peak, false);
}

function make_CEM_sub_row(tbody, peak) {
  var row = tbody.insertRow(tbody.rows.length);
  row['data_peak'] = peak;
  row.className = "sub_peak";
  add_text_cell(row,'\u2022', 'no_swatch');
  add_text_cell(row, '', 'col_db');
  add_text_cell(row, '', 'col_id');
  add_text_cell(row, '', 'col_name');
  add_text_cell(row, evstr(peak, 'log_adj_pvalue'), 'col_evalue');
  if (data['options']['neg_sequences']) {
    add_text_cell(row, evstr(peak, 'fisher_log_adj_pvalue'), "col_fisherpv");
  }
  add_text_cell(row, pvstr(peak), 'col_pvalue');
  if (data['options']['neg_sequences']) {
    add_text_cell(row, log2str(peak['neg_log_adj_pvalue'],1), "col_negative_binomial");
  } else {
    add_text_cell(row, '', "col_negative_binomial");
  }
  if (data['options']['mcc']) {
    add_text_cell(row, peak['mcc'].toFixed(3), "col_MCC");
  } else {
    add_text_cell(row, '', "col_MCC");
  }
  add_text_cell(row, peak['center'], "col_blocation");
  add_text_cell(row, peak['spread'], 'col_bwidth');
  add_text_cell(row, Math.round(peak['sites']), "col_bsites");
  add_text_cell(row, '', "col_tsites");
  if (data['options']['neg_sequences']) {
    add_text_cell(row, Math.round(peak['neg_sites']), "col_negbsites");
  } else {
    add_text_cell(row, '', "col_negbsites")
  }
  add_text_cell(row, '', "col_negtsites");
  add_text_cell(row, '', "col_maxprob");
  add_text_cell(row, '', "col_problocation");
  add_text_cell(row, '', "col_nbinstested");
  add_text_cell(row, '', "col_score");
  add_text_cell(row, '', "col_OEbins");
  row.addEventListener('mouseover', highlight_peak, false);
  row.addEventListener('mouseout', dehighlight_peak, false);
}

function make_CEM_skip_row(tbody, n_skipped) {
  var row, cell, desc;
  if (n_skipped === 0) return;
  row = tbody.insertRow(tbody.rows.length);
  row.className = "sub_peak";

  if (n_skipped === 1) {
    desc = "1 peak hidden due to filters";
  } else {
    desc = n_skipped + " peaks hidden due to filters";
  }

  cell = row.insertCell(row.cells.length);
  cell.colSpan = 19;
  cell.style.textAlign = "center";
  cell.style.fontWeight = "bold";
  cell.appendChild(document.createTextNode(desc));
}

/*
 * make_CEM_table
 *
 * Generate the table which lists centrally enriched motifs.
 */
function make_CEM_table() {
  var motif_sort, peak_sort;
  var filter, motifs, filtered, motif, peaks, motif_dbs;
  var tbl, tbody, row, cell, i, j, skipped;
  // get the filter and sort comparator
  motif_sort = motif_sort_cmp(parseInt($('motif_sort').value));
  peak_sort = peak_sort_cmp(parseInt($('peak_sort').value));
  filter = get_filter();

  motifs = data['motifs'];
  // sort the motif peaks
  for (i = 0; i < motifs.length; i++) {
    motif = motifs[i];
    peaks = motif['peaks'];
    for (j = 0; j < peaks.length; j++) {
      peaks[j]["filtered"] = filter_peak(filter, peaks[j]);
    }
    peaks.sort(peak_sort);
  }
  // filter the motifs
  filtered = [];
  for (i = 0; i < motifs.length; i++) {
    if (filter_motif(filter, motifs[i])) continue;
    if (motifs[i]["peaks"][0]["filtered"]) continue;
    filtered.push(motifs[i]);
  }
  // sort
  filtered.sort(motif_sort);
  // limit
  if (filter["on_count"]) {
    if (filtered.length > filter["count"]) filtered.length = filter["count"];
  }
  // re-add any omitted s_motifs motifs
  outer_loop:
  for (i = 0; i < s_motifs.length; i++) {
    if (s_motifs[i] == null) continue;
    for (j =0; j < filtered.length; j++) {
      if (filtered[j] === s_motifs[i]) {
        continue outer_loop;
      }
    }
    filtered.push(s_motifs[i]);
  }
  // sort again
  filtered.sort(motif_sort);

  // clear the table
  tbl = $("motifs");
  for (i = tbl.tBodies.length - 1; i >= 0; i--) {
    tbody = tbl.tBodies[i];
    tbody.parentNode.removeChild(tbody);
  }

  motif_dbs = data['motif_dbs'];
  // add the new rows to the table
  for (i = 0; i < filtered.length; i++) {
    motif = filtered[i];
    peaks = motif['peaks'];
    tbody = document.createElement('tbody');
    tbody.className = "peak_group";
    tbody["data_motif"] = motif;
    tbody.addEventListener('mouseover', hover_logo, false);
    tbody.addEventListener('mouseout', dehover_logo, false);
    make_CEM_main_row(tbody, motif);
    skipped = 0;
    for (j = 1; j < peaks.length; j++) {
      if (filter_peak(filter, peaks[j])) {
        skipped++;
        continue;
      }
      make_CEM_sub_row(tbody, peaks[j]);
    }
    make_CEM_skip_row(tbody, skipped);
    tbl.appendChild(tbody);
  }
  // note the count of filtered motifs
  if (filtered.length != motifs.length) {
    skipped =  motifs.length - filtered.length;
    tbody = document.createElement('tbody');
    row = tbody.insertRow(tbody.rows.length);

    if (skipped === 1) {
      desc = "1 motif hidden due to filters";
    } else {
      desc = skipped + " motifs hidden due to filters";
    }
    cell = row.insertCell(row.cells.length);
    cell.colSpan = 19;
    cell.style.textAlign = "center";
    cell.style.fontWeight = "bold";
    cell.appendChild(document.createTextNode(desc));
    tbl.appendChild(tbody);
  }
}

function get_filter() {
  var filter, id_pat, alt_pat, alt_re, log_evalue_max, spread, count;
  var neg_log_pvalue_min;
  filter = {};
  // get the db filter
  filter["on_db"] = $("filter_on_db").checked;
  filter["db"] = $("filter_db").value;
  // get the id filter
  filter["on_id"] = $("filter_on_id").checked;
  id_pat = $("filter_id").value;
  try {
    filter["id"] = new RegExp(id_pat, "i");
    $("filter_id").className = "";
  } catch (err) {
    $("filter_id").className = "error";
    filter["on_id"] = false;
  }
  // get the name filter
  filter["on_alt"] = $("filter_on_alt").checked;
  alt_pat = $("filter_alt").value;
  try {
    filter["alt"] = new RegExp(alt_pat, "i");
    $("filter_alt").className = "";
  } catch (err) {
    filter["on_alt"] = false;
    $("filter_alt").className = "error";
  }
  // get the evalue filter
  filter["on_pvalue"] = $("filter_on_evalue").checked;
  if ((log_evalue_max = str2log($("filter_evalue").value)) != null) {
    filter["log_pvalue"] = log_evalue_max - Math.log(data['tested']);
    $("filter_evalue").className = "";
  } else {
    filter["on_pvalue"] = false;
    $("filter_evalue").className = "error";
  }
  // get the Fisher pv filter
  filter["on_fisherpv"] = $("filter_on_fisherpv").checked;
  if ((log_fisherpv_max = str2log($("filter_fisherpv").value)) != null) {
    filter["log_fisherpv"] = log_fisherpv_max - Math.log(data['tested']);
    $("filter_fisherpv").className = "";
  } else {
    filter["on_fisherpv"] = false;
    $("filter_fisherpv").className = "error";
  }
  // get the spread filter
  filter["on_spread"] = $("filter_on_binwidth").checked;
  spread = parseInt($("filter_binwidth").value);
  if (isNaN(spread) || spread < 1) {
    filter["on_spread"] = false;
    $("filter_binwidth").className = "error";
  } else {
    filter["spread"] = spread;
    $("filter_binwidth").className = "";
  }
  // get the negative binomial test filter
  filter["on_neg"] = data['options']['neg_sequences'] && $("filter_on_negbintest").checked;
  if ((neg_log_pvalue_min = str2log($("filter_negbintest").value)) != null) {
    $("filter_negbintest").className = "";
    filter["neg_log_pvalue"] = neg_log_pvalue_min - Math.log(data['tested']);
  } else {
    filter["on_neg"] = false;
    $("filter_negbintest").className = "error";
  }
  // get the motif count limit
  filter["on_count"] = $("filter_on_top").checked;
  count = parseInt($("filter_top").value);
  if (isNaN(count) || count < 1) {
    filter["on_count"] = false;
    $("filter_top").className = "error";
  } else {
    filter["count"] = count;
    $("filter_top").className = "";
  }
  return filter; 
}

function filter_motif(filter, motif) {
  if (filter["on_db"] && motif["db"] != filter["db"]) return true;
  if (filter["on_id"] && !filter["id"].test(motif["id"])) return true;
  if (filter["on_alt"] && !filter["alt"].test(motif["alt"])) return true;
  return false;
}

function filter_peak(filter, peak) {
  if (filter["on_fisherpv"] && peak["fisher_log_adj_pvalue"] > filter["log_fisherpv"]) return true;
  if (filter["on_pvalue"] && peak["log_adj_pvalue"] > filter["log_pvalue"]) return true;
  if (filter["on_spread"] && peak["spread"] > filter["spread"]) return true;
  if (filter["on_neg"] && peak["neg_log_adj_pvalue"] < filter["neg_log_pvalue"]) return true;
  return false;
}

function filter_CEM_table() {
  "use strict";
  var tbl, tbody, tr, motif, peaks, i, j, filter;
  tbl = $("motifs");
  filter = get_filter();
  for (i = 0; i < tbl.tBodies.length; i++) {
    tbody = tbl.tBodies[i];
    motif = tbody["data_motif"];
    toggle_class(tbody, "filtered", filter_motif(filter, motif));
    for (j = 0; j < tbody.rows.length; j++) {

    }
  }
}

/*
 * show_all_peaks
 *
 * Show or hide sub-peaks
 */
function show_all_peaks(param) {
  var tbl = $("motifs");
  var tbody = tbl.tBodies[0];
  var NValue=param.childNodes[0].nodeValue; // Catch the motif (based on argument value sent by clicking on arrow)
  var bin_number=0;
  for (var i=0; i<tbody.rows.length;i++) { // For each motif
    if (tbody.rows[i].className==param.className) {    // For each sub-peaks
      bin_number++;
      if (must_be_display(param.className,bin_number)==false || NValue=="\u21A5") { // If it has to be hidden or arrow was up
        tbody.rows[i].style.display="none";    // Hide it
      }
      else {
      tbody.rows[i].style.display="table-row";    // Show it
      }
    }
  }
  param.childNodes[0].nodeValue= (NValue=="\u21A7") ? "\u21A5" : "\u21A7" ; // Change arrow orientation
}

function toggle_peaks(e) {
  var expander, group;
  if (!e) e = window.event;
  if (e.target) expander = e.target;
  else if (e.srcElement) expander = e.srcElement;
  group = find_parent(expander.parentNode, "peak_group");
  toggle_class(group, "more");
}

/*
 * must_be_display
 *
 * Check all sub-peaks and verify if they have to be displayed or not (based on filters)
 */
function must_be_display(ID, bin_number) {
  "use strict";
  var motifs, i, motif, peak, log_pvalue_max, log_evalue_max, log_pvalue_min;
  motifs = data['motifs'];
  for (i = 0; i < motifs.length; i++) {
    motif = motifs[i];
    if (motif['db'] + motif['id'] == ID) {    // Catch the motif
      peak = motif['peaks'][bin_number];    // Catch the sub-peaks
      if ($("filter_on_evalue").checked) {
        if ((log_evalue_max = str2log($("filter_evalue").value)) != null) {
          log_pvalue_max = log_evalue_max - Math.log(data['tested']);
        } else {
          log_pvalue_max = 0;
        }
        if (log_pvalue_max < peak['log_adj_pvalue']) return false; 
      }
      if ($("filter_on_fisherpv").checked) {
        if ((log_evalue_max = str2log($("filter_fisherpv").value)) != null) {
          log_pvalue_max = log_evalue_max - Math.log(data['tested']);
        } else {
          log_pvalue_max = 0;
        }
        if (log_pvalue_max < peak['fisher_log_adj_pv']) return false; 
      }
      if ($("filter_on_negbintest").checked) {
        if ((log_pvalue_max = str2log($("filter_negbintest").value)) == null) {
          log_pvalue_min = Math.log(data['tested']);
        }
        if (log_pvalue_min > peak['neg_log_adj_pvalue']) return false; 
      }
      if ($("filter_on_binwidth").checked && 
          parseInt($("filter_binwidth").value) > peak['spread']) {
            return false;
      }
    }
  }
  return true;
}

/*
 * make_PM_table
 *
 * Generate the table which lists plotted motifs
 */
function make_PM_table() {
  swap = null;
  var graphed = [];
  var unused = [];
  for (var i = 1; i < palate.length; i++) {
    if (s_motifs[i-1]) graphed.push(s_motifs[i-1]);
    else unused.push(i);
  }
  graphed.sort(sort_motif_evalue);

  var tbl = $("graph_list");
  var tbody = tbl.tBodies[0];
  while (tbody.rows.length > 0) {
    tbody.deleteRow(0);
  }
  // add the new rows to the table
  for (var i = 0; i < graphed.length; i++) {
    var motif = graphed[i];
    var colouri = motif['colouri'];
    if (!colouri) colouri = 0;
    var row = tbody.insertRow(tbody.rows.length);
    row['motif'] = motif;
    var swatch = make_swatch(colouri);
    swatch.onmousedown = swap_colour;
    add_cell(row, swatch);
    add_cell(row, make_link(motif['id'], motif['url']));
    if (!s_logos[colouri-1]) {
      s_logos[colouri-1] = document.createElement("canvas");
      var pspm = new Pspm(motif['pwm'], motif['id'], 0, 0, 
          motif['motif_nsites'], motif['motif_evalue']);
      var logo = logo_1(alphabet, "", pspm);
      draw_logo_on_canvas(logo, s_logos[colouri-1], false, 0.3);
    }
    add_cell(row, s_logos[colouri-1]);
  }
  var div = $("unused_colours");
  while (div.firstChild) div.removeChild(div.firstChild);
  $("unused_colours_section").style.display = (unused.length > 0 ? "block" : "none");
  for (var i = 0; i < unused.length; i++) {
    var swatch = make_swatch(unused[i]);
    swatch['colouri'] = unused[i];
    swatch.onclick = set_colour;
    div.appendChild(swatch);
  }
}

/*
 * make_MP_graph
 *
 * Create a motif probability graph on the canvas.
 */
function make_MP_graph() {
  var canvas = $("graph");
  canvas.width = canvas.width;
  if (canvas.getContext) {
    var ctx = canvas.getContext('2d');
    make_MP_graph2(ctx, canvas.width, canvas.height);
  }
}

function handle_MP_graph_mousemove(e) {
  "use strict";
  var graph, start, stop, left, width, pop;
  graph = $("graph");
  graph_click["stop"] = e.pageX - graph.getBoundingClientRect().left;
  // constrain stop and start to the graph
  start = graph_click["start"];
  if (start < graph_metrics.left_mark) {
    start = graph_metrics.left_mark;
  } else if (start > graph_metrics.right_mark) {
    start = graph_metrics.right_mark;
  }
  stop = graph_click["stop"];
  if (stop < graph_metrics.left_mark) {
    stop = graph_metrics.left_mark;
  } else if (stop > graph_metrics.right_mark) {
    stop = graph_metrics.right_mark;
  }
  // pick the smaller to be the left
  if (start < stop) {
    left = start;
    width = stop - start;
  } else {
    left = stop;
    width = start - stop;
  }
  // visualize the selected range 
  pop = $("pop_peak");
  if (width > 10) {
    pop.style.width = width + "px";
    pop.style.left = left + "px";
    pop.style.visibility = "visible";
  } else {
    pop.style.visibility = "hidden";
  }
}

function handle_MP_graph_mouseup(e) {
  "use strict";
  var graph, start, stop, left, right, left_val, right_val, pop, l, w, d, unit;
  document.removeEventListener("mouseup", handle_MP_graph_mouseup, false);
  document.removeEventListener("mousemove", handle_MP_graph_mousemove, false);
  graph = $("graph");
  graph_click["stop"] = e.pageX - graph.getBoundingClientRect().left;
  // hide the range preview
  pop = $("pop_peak");
  pop.style.visibility = "hidden";
  // constrain stop and start to the graph
  start = graph_click["start"];
  if (start < graph_metrics.left_mark) {
    start = graph_metrics.left_mark;
  } else if (start > graph_metrics.right_mark) {
    start = graph_metrics.right_mark;
  }
  stop = graph_click["stop"];
  if (stop < graph_metrics.left_mark) {
    stop = graph_metrics.left_mark;
  } else if (stop > graph_metrics.right_mark) {
    stop = graph_metrics.right_mark;
  }
  // pick the smaller to be the left
  if (start < stop) {
    left = start;
    right = stop;
  } else {
    left = stop;
    right = start;
  }
  l = graph_metrics.left_mark;
  w = graph_metrics.right_mark - graph_metrics.left_mark;
  d = graph_metrics.right_val - graph_metrics.left_val;
  unit = w / d;
  // convert into graph values
  left_val = graph_metrics.left_val + Math.round((left - l) / unit);
  right_val =  graph_metrics.left_val + Math.round((right - l) / unit);
  // check if we're doing a legend move and not a zoom
  if ((right - left) < 10 || left_val == right_val) {
    move_legend(e);
    return;
  }
  // add a zoom to the stack
  zooms.push({"left_val": left_val, "right_val": right_val});
  make_MP_graph();
  $("zoom_out").disabled = false;
  $("zoom_center").disabled = false;
}

function handle_MP_graph_mousedown(e) {
  "use strict";
  var graph;
  document.addEventListener("mouseup", handle_MP_graph_mouseup, false);
  document.addEventListener("mousemove", handle_MP_graph_mousemove, false);
  graph = $("graph");
  graph_click["start"] = e.pageX - graph.getBoundingClientRect().left;
  
}

function handle_zoom_out_click() {
  if (zooms.length > 0) {
    zooms.pop();
    make_MP_graph();
    if (zooms.length == 0) {
      $("zoom_out").disabled = true;
      $("zoom_center").disabled = true;
    }
  }
}

function handle_zoom_center_click() {
  var zoom, reach;
  if (zooms.length > 0) {
    zoom = zooms.pop();
    reach = Math.max(1, Math.round((zoom["right_val"] - zoom["left_val"]) / 2));
    zooms.push({"left_val": -reach, "right_val": reach});
    make_MP_graph();
  }
}

function add_MP_graph_listeners() {
  "use strict";
  var graph, zoom_out, zoom_center;
  graph = $("graph");
  graph.addEventListener("mousedown", handle_MP_graph_mousedown, false);
  zoom_out = $("zoom_out");
  zoom_out.disabled = true;
  zoom_out.addEventListener("click", handle_zoom_out_click, false);
  zoom_center = $("zoom_center");
  zoom_center.addEventListener("click", handle_zoom_center_click, false);
  zoom_center.disabled = true;
}

function download_eps() {
  var canvas = $("graph");
  canvas.width = canvas.width;
  if (canvas.getContext) {
    var ctx = canvas.getContext('2d');
    var eps_ctx = new EpsContext(ctx, canvas.width, canvas.height);
    eps_ctx.register_font("14pt Helvetica", "Helvetica", 14 / 3 * 4);
    eps_ctx.register_font("16px Helvetica", "Helvetica", 16);
    eps_ctx.register_font("9px Helvetica", "Helvetica", 9);
    make_MP_graph2(ctx, canvas.width, canvas.height);
    $("eps_content").value = eps_ctx.eps();
  }
}

function make_MP_graph2(ctx, width, height) {
  "use strict";
  var windo, type, legend, plot_negative, plot_distance, motifs, rset, i, motif;
  var name, sig, colour, weights, graph, peak_highlight;
  // get the graph settings
  windo = parseInt($("windo").value);
  if (isNaN(windo) || windo < 1) {
    $("windo").value = windo = default_smoothing_window;
  }
  type = parseInt($("plot_type").value);
  legend = parseInt($("legend").value);
  plot_negative = parseInt($("plot_negative").value);
  plot_distance = parseInt($("plot_distance").value) != 0;
  // get the selected motifs
  motifs = [];
  for (i = 0; i < s_motifs.length; i++) {
    if (s_motifs[i] != null) motifs.push(s_motifs[i]);
  }
  // sort the motifs
  motifs.sort(sort_motif_evalue);
  // create a result set with all the selected motifs
  rset = new CentrimoRSet(data["seqlen"]);
  for (i = 0; i < motifs.length; i++) {
    motif = motifs[i];
    name = motif["id"];
    if (motif["alt"]) name = motif["alt"] + " " + motif["id"];
    sig = "p=" + log2str(motif["best_log_adj_pvalue"], 1);
    colour = palate[motif["colouri"]];
    if (plot_negative) {
      rset.add(name, sig, colour, motif["len"], motif["total_sites"],
        motif["sites"], motif["neg_total_sites"], motif["neg_sites"]);
    } else {
      rset.add(name, sig, colour, motif["len"], motif["total_sites"],
        motif["sites"], 0, 0);
    }
  }
  // get the smoothing weights
  weights = (type == 1 ? triangular_weights(windo) : uniform_weights(windo));
  // get the zoom
  var range_left = null;
  var range_right = null;
  if (zooms.length > 0) {
    var zoom = zooms[zooms.length - 1];
    range_left = zoom["left_val"];
    range_right = zoom["right_val"];
  }
  // now make a new graph from the result set and smoothing weights
  graph = new CentrimoGraph(rset, weights, "CentriMo " + data["version"], range_left, range_right, plot_distance);
  graph_metrics = graph.draw_graph(ctx, width, height, legend, legend_x, legend_y);
  peak_highlight = $("pop_peak");
  peak_highlight.style.top = graph_metrics.top_edge + "px";
  peak_highlight.style.height = (graph_metrics.bottom_edge - graph_metrics.top_edge) + "px";
}

function sync_sort_selection () {
  "use strict";
  var i, mapper, motif_sort, region_sort;
  motif_sort = $("motif_sort");
  region_sort = $("peak_sort");
  if (typeof sync_sort_selection.mapper === "undefined") {
    var id2idx;
    // first map region id to index
    id2idx = {};
    for (i = 0; i < region_sort.options.length; i++) {
      id2idx[sort_table["region"][parseInt(region_sort.options[i].value, 10)]["id"]] = i;
    }
    // now generate a mapping of index in motif sort to index in region sort
    mapper = [];
    for (i = 0; i < motif_sort.options.length; i++) {
      mapper[i] = id2idx[sort_table["motif"][parseInt(motif_sort.options[i].value, 10)]["pair"]];
    }
    sync_sort_selection.mapper = mapper;
  } else {
    mapper = sync_sort_selection.mapper;
  }
  if (!$('allow_peak_sort').checked) {
    region_sort.selectedIndex = mapper[motif_sort.selectedIndex];
  }
}

function populate_sort_list (sellist, items) {
  var i, j, item, opt, priority, selected;
  priority = 0;
  selected = 0;
  for (i = 0, j = 0; i < items.length; i++) {
    item = items[i];
    if (typeof item["show"] === 'undefined' || item["show"]) {
      opt = document.createElement("option");
      opt.innerHTML = item["name"];
      opt.value = i;
      sellist.add(opt, null);
      if (typeof item["priority"] !== 'undefined' && item["priority"] > priority) {
        selected = j;
        priority = item["priority"];
      }
      j++;
    }
  }
  sellist.selectedIndex = selected;
}

function populate_sort_lists() {
  "use strict";
  var i, motif_sort, region_sort, motif_sort_list, region_sort_list;
  motif_sort = $("motif_sort");
  region_sort = $("peak_sort");
  try {motif_sort.removeEventListener("click", sync_sort_selection, false);} catch (e) {}
  try {motif_sort.removeEventListener("change", sync_sort_selection, false);} catch (e) {}
  for (i = motif_sort.options.length-1; i >= 0; i--) motif_sort.remove(i);
  for (i = region_sort.options.length-1; i >= 0; i--) region_sort.remove(i);
  motif_sort_list = sort_table["motif"];
  region_sort_list = sort_table["region"];
  populate_sort_list(motif_sort, motif_sort_list);
  populate_sort_list(region_sort, region_sort_list);
  sync_sort_selection();
  motif_sort.addEventListener("click", sync_sort_selection, false);
  motif_sort.addEventListener("change", sync_sort_selection, false);
}

function make_other_settings() {
  $("opt_obj").textContent = data.options.cd ? "central distance enrichment (CD)" : (data.options.local ? "local region enrichment (LE)" : "central region enrichment (CE)");
  $("opt_xalph").textContent = data.options.xalph != "" ? "Yes: use alphabet in file" + data.options.xalph: "No";
  $("opt_motif_pseudo").textContent = data.options.motif_pseudo;
  $("opt_seqlen").textContent = data.options.seqlen == 0 ? "None" : data.options.seqlen;
  $("opt_use_pvalues").textContent = data.options.use_pvalues ? "p-values" : "log-odds scores";
  $("opt_score").textContent = data.options.use_pvalues ? data.options.score : 
    data.options.use_lo_fraction ? 100*data.options.score + "% of maximum log-odds score" : data.options.score + " (bits)";
  $("opt_optimize_score").textContent = data.options.optimize_score ? "Yes" : "No";
  $("opt_minreg").textContent = data.options.minbin;
  $("opt_maxreg").textContent = data.options.maxbin;
  $("opt_strands").textContent = data.options.norc ? (data.options.sep ? "scan with complementary motifs, too" : "scan given strands only") : "scan both strands if alphabet is complementable";
  $("opt_flip").textContent = data.options.flip ? "'reflected' around sequence centers" : "same as for positive strand";
  $("opt_noseq").textContent = data.options.noseq ? "No" : "Yes";

}

    </script>
    <style type="text/css">
div.graph_box {
  position: relative;
}
div.pop_graph_peak {
  position:absolute; 
  left: 0;
  top: 0; 
  z-index: 5; 
  width: 10px;
  height: 10px; 
  opacity: 0.2; 
  background-color: #3333ff;
  visibility: hidden;
}
table.inputs, table.alpha_bg_table {
  margin-top: 20px;
  border-collapse:collapse;
}
table.inputs * td, table.inputs * th, table.alpha_bg_table * td, table.alpha_bg_table * th {
  padding-left: 15px;
  padding-right: 15px;
  padding-top: 1px;
  padding-bottom: 1px;
}
table.motifs {
  margin-top: 20px;
  border-collapse:collapse;
}
table.motifs * td, table.motifs * th {
  padding-left: 15px;
  padding-right: 15px;
  padding-top: 1px;
  padding-bottom: 1px;
}
table.motifs * td.col_blocation, table.motifs * td.col_bwidth, 
table.motifs * td.col_bsites, table.motifs * td.col_tsites,
table.motifs * td.col_maxprob, table.motifs * td.col_concentration,
table.motifs * td.col_problocation,
table.motifs * td.col_nbinstested, table.motifs * td.col_score {
  text-align: right;
  padding-right: 40px;
}
table.motifs tbody:hover { 
  background: #ddddff; 
}
table.motifs tbody tr:hover {
  background: #ccccff; 
}
table.hide_db .col_db {
  display: none;
}
table.hide_id .col_id {
  display: none;
}
table.hide_name .col_name {
  display: none;
}
table.hide_consensus .col_consensus {
  display: none;
}
table.hide_fisherpv .col_fisherpv {
  display: none;
}
table.hide_evalue .col_evalue {
  display: none;
}
table.hide_pvalue .col_pvalue {
  display: none;
}
table.hide_MCC .col_MCC {
  display: none;
}
table.hide_concentration .col_concentration {
  display: none;
}
table.hide_maxprob .col_maxprob {
  display: none;
}
table.hide_bsites .col_bsites {
  display: none;
}
table.hide_negbsites .col_negbsites {
  display: none;
}
table.hide_blocation .col_blocation {
  display: none;
}
table.hide_hpeak .col_problocation {
  display: none;
}
table.hide_bwidth .col_bwidth {
  display: none;
}
table.hide_tsites .col_tsites {
  display: none;
}
table.hide_negtsites .col_negtsites {
  display: none;
}
table.hide_nbinstested .col_nbinstested {
  display: none;
}
table.hide_score .col_score {
  display: none;
}
table.hide_negative_binomial .col_negative_binomial {
  display: none;
}
table.hide_OEbins .col_OEbins {
  display: none;
}
div.graph_options_section {
  width:30%; 
  float:right;
}
div.graph_options_section h5 {
  margin-top: 10px;
}
table.graph_list {
  border-collapse:collapse;
}
table.graph_list * td, table.graph_list * th {
  padding-left: 5px;
  padding-right: 5px;
  padding-top: 1px;
  padding-bottom: 1px;
}
th.deselect {
  font-size:25px; 
  cursor: default;
}
th.deselect:hover {
  color: red;
}
div.filter {
  display: inline-block;
  padding-right: 10px;
}
div.swatch {
  margin: auto;
  width: 20px;
  height: 20px;
  text-align: center;
  font-size: 16px;
  border: 1px solid black;
  cursor: default;
}
div.swatch:hover {
  width: 16px;
  height: 16px;
  font-size: 16px;
  border: 3px outset black;
}
div.swatch:active {
  width: 16px;
  height: 16px;
  font-size: 16px;
  border: 3px inset black;
}
span.expander {
  cursor: pointer;
  font-size: larger;
}
div.pop_logo {
  position:absolute;
  z-index:1;
  top:0px;
  left:0px;
  border: 3px outset black;
  background-color: white;
  display:none;
}
div.pop_colour {
  position:absolute;
  z-index:1;
  top:0px;
  left:0px;
  margin-left: -13px;
  margin-top: -13px;
  display:none;

}
div.pop_content {
  position:absolute;
  z-index:1;
  width:300px;
  padding: 5px;
  background: #E4ECEC;
  font-size: 12px;
  font-family: Arial;
  border-style: double;
  border-width: 3px;
  border-color: #AA2244;
  display:none;
}

span.arrow {
  font-size: larger;
  color: red;
}

#unused_colours div.swatch {
  display: inline-block;
  margin-right: 5px;
}

.no_swatch {
  text-align: center;
  font-size: larger;
}

input.error:enabled {
  background: #FF5555;
}

tr.sub_peak {
  display: none;
}

tbody.more > tr.sub_peak {
  display: table-row;
}

    </style>
    <style type="text/css">
/* The following is the content of meme.css */
body { background-color:white; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif;}

div.help {
  display: inline-block;
  margin: 0px;
  padding: 0px;
  width: 12px;
  height: 13px;
  cursor: pointer;
  background-image: url(data:image/gif;base64,R0lGODlhDAANAIABANR0AP///yH5BAEAAAEALAAAAAAMAA0AAAIdhI8Xy22MIFgv1DttrrJ7mlGNNo4c+aFg6SQuUAAAOw==);
}

div.help:hover {
  background-image: url(data:image/gif;base64,R0lGODlhDAANAKEAANR0AP///9R0ANR0ACH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEAAAIALAAAAAAMAA0AAAIdDGynCe3PgoxONntvwqz2/z2K2ImjR0KhmSIZUgAAOw==);
}

p.spaced { line-height: 1.8em;}

span.citation { font-family: "Book Antiqua", "Palatino Linotype", serif; color: #004a4d;}

p.pad { padding-left: 30px; padding-top: 5px; padding-bottom: 10px;}

td.jump { font-size: 13px; color: #ffffff; background-color: #00666a;
  font-family: Georgia, "Times New Roman", Times, serif;}

a.jump { margin: 15px 0 0; font-style: normal; font-variant: small-caps;
  font-weight: bolder; font-family: Georgia, "Times New Roman", Times, serif;}

h2.mainh {font-size: 1.5em; font-style: normal; margin: 15px 0 0;
  font-variant: small-caps; font-family: Georgia, "Times New Roman", Times, serif;}

h2.line {border-bottom: 1px solid #CCCCCC; font-size: 1.5em; font-style: normal;
  margin: 15px 0 0; padding-bottom: 3px; font-variant: small-caps;
  font-family: Georgia, "Times New Roman", Times, serif;}

h4 {border-bottom: 1px solid #CCCCCC; font-size: 1.2em; font-style: normal;
  margin: 10px 0 0; padding-bottom: 3px; font-family: Georgia, "Times New Roman", Times, serif;}

h5 {margin: 0px}

a.help { font-size: 9px; font-style: normal; text-transform: uppercase;
  font-family: Georgia, "Times New Roman", Times, serif;}

div.pad { padding-left: 30px; padding-top: 5px; padding-bottom: 10px;}

div.pad1 { margin: 10px 5px;}

div.pad2 { margin: 25px 5px 5px;}
h2.pad2 { padding: 25px 5px 5px;}

div.pad3 { padding: 5px 0px 10px 30px;}

div.box { border: 2px solid #CCCCCC; padding:10px; overflow: hidden;}

div.bar { border-left: 7px solid #00666a; padding:5px; margin-top:25px; }

div.subsection {margin:25px 0px;}

img {border:0px none;}

th.majorth {text-align:left;}
th.minorth {font-weight:normal; text-align:left; width:8em; padding: 3px 0px;}
th.actionth {font-weight:normal; text-align:left;}

.explain h5 {font-size:1em; margin-left: 1em;}

div.doc {margin-left: 2em; margin-bottom: 3em;}

th.trainingset {
  border-bottom: thin dashed black; 
  font-weight:normal; 
  padding:0px 10px;
}
div.pop_content {
  position:absolute;
  z-index:50;
  width:300px;
  padding: 5px;
  background: #E4ECEC;
  font-size: 12px;
  font-family: Arial;
  border-style: double;
  border-width: 3px;
  border-color: #AA2244;
  display:none;
}

div.pop_content > *:first-child {
  margin-top: 0px;
}

div.pop_content h1, div.pop_content h2, div.pop_content h3, div.pop_content h4, 
div.pop_content h5, div.pop_content h6, div.pop_content p {
  margin: 0px;
}

div.pop_content p + h1, div.pop_content p + h2, div.pop_content p + h3, 
div.pop_content p + h4, div.pop_content p + h5, div.pop_content p + h6 {
  margin-top: 5px;
}

div.pop_content p + p {
  margin-top: 5px;
}

div.pop_content > *:last-child {
  margin-bottom: 0px;
}

div.pop_content div.pop_close {
  /* old definition */
  float:right;
  bottom: 0;
}

div.pop_content span.pop_close, div.pop_content span.pop_back {
  display: inline-block;
  border: 2px outset #661429;
  background-color: #CCC;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 0px;
  padding-bottom: 0px;
  cursor: pointer;
  color: #AA2244; /*#661429;*/
  font-weight: bold;
}

div.pop_content span.pop_close:active, div.pop_content span.pop_back:active {
  border-style: inset;
}

div.pop_content span.pop_close {
  float:right;
  /*border: 2px outset #AA002B;*/
  /*color: #AA2244;*/
}

div.pop_content:not(.nested) .nested_only {
  display: none;
}

div.pop_back_sec {
  margin-bottom: 5px;
}

div.pop_close_sec {
  margin-top: 5px;
}

table.hide_advanced tr.advanced {
  display: none;
}
span.show_more {
  display: none;
}
table.hide_advanced span.show_more {
  display: inline;
}
table.hide_advanced span.show_less {
  display: none;
}


/*****************************************************************************
 * Program logo styling
 ****************************************************************************/
div.prog_logo {
  border-bottom: 0.25em solid #0f5f60;
  height: 4.5em;
  width: 24em;
  display:inline-block;
}
div.prog_logo img {
  float:left;
  width: 4em;
  border-style: none;
  margin-right: 0.2em;
}
div.prog_logo h1, div.prog_logo h1:hover, div.prog_logo h1:active, div.prog_logo h1:visited {
  margin:0;
  padding:0;
  font-family: Arial, Helvetica,  sans-serif;
  font-size: 3.2em;
  line-height: 1em;
  vertical-align: top;
  display: block;
  color: #026666;
  letter-spacing: -0.06em;
  text-shadow: 0.04em 0.06em 0.05em #666;
}
div.prog_logo h2, div.prog_logo h2:hover, div.prog_logo h2:active, div.prog_logo h2:visited {
  display: block;
  margin:0;
  padding:0;
  font-family: Helvetica, sans-serif;
  font-size: 0.9em;
  line-height: 1em;
  letter-spacing: -0.06em;
  color: black;
}

div.big.prog_logo {
  font-size: 18px;
}


    </style>
  </head>
  <body onload="page_loaded()" onpageshow="page_shown(event)">
    <!-- Popups -->
    <div id="logo_popup" class="pop_logo">
      <canvas id="logo_popup_canvas" width="200" height="50"></canvas>
      <canvas id="logo_popup_canvas_rc" width="200" height="50"></canvas>
    </div>
    <!-- Help popups -->
    <div class="pop_content" id="pop_alph_name">
      <script>print_doc_para('pop_alph_name', 'alph-name', 'The ');</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_alph_bg">
      <script>print_doc_para('pop_alph_bg', 'alph-bg', 'The ');</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_results">
      <script>print_doc("pop_results", "centrimo-results-tsv");</script>
      <script>print_doc("pop_results", "motif-consensus");</script>
      <div style="float:right; bottom:0px;">[
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_sites">
      <script>print_doc("pop_sites", "centrimo-sites-txt");</script>
      <div style="float:right; bottom:0px;">[
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" style="width:400px" id="pop_prob_graph">
      <p>Each "motif probability curve" shows the (estimated) probability of the
      <b>best</b> match to a given motif occurring at a given position in the
      input sequences.  This estimated probability is based only on sequences that
      contain at least one match with <span id="ins_pop_prob_graph2"></span> <span id="ins_pop_prob_graph1"></span>
      than the <span id="ins_pop_prob_graph3"></span> threshold defined for this motif, 
      and is the maximum likelihood estimate of the conditional probability shown below.</p>
      <p>Points (X,Y) on the plot are:<br>
      &nbsp;&nbsp;Y = Pr(best match occurs at position X | sequence contains a match)</p>
      <p><b>Note:</b> The plots are smoothed according to the function 
      selected from the "Smoothing" menu on the right. Setting the smoothing
      window size to 1 turns off smoothing.</p>
      <p>If a negative dataset has been supplied then two curves are drawn for
      each motif, one for each dataset. The distribution of the motif in the
      primary dataset is plotted with a single unbroken curve, whereas the distribution in
      the negative dataset is plotted with a dashed curve.</p>
      <script>
	$("ins_pop_prob_graph1").innerHTML = (data['options']['use_pvalues']) ? "below" : "above";
	$("ins_pop_prob_graph2").innerHTML = (data['options']['use_pvalues']) ? "adjusted motif <i>p</i>-value" : "score";
	$("ins_pop_prob_graph3").innerHTML = (data['options']['use_pvalues']) ? "<i>p</i>-value" : "score";
      </script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_plotting">
      <p>This shows a listing of all motifs currently plotted on the graph.</p>
      <p>The color used to plot a motif can be changed by clicking on the
      color swatch next to the motif you want to change, followed by clicking
      on the color swatch you wish to swap it with.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_unused_colours">
      <p>These are extra colors you may use for plotting motifs.</p>  
      <p>Click on the color swatch next to one of the above motifs, then click 
      on one of these "unused color" swatches to change the color of the 
      motif's plot.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" style="width: 500px" id="pop_graph">
      <p>These options change the display of the graph.</p>
      <dl>
        <dt>Smoothing:</dt>
        <dd><p>Allows selection of the smoothing function applied to the graph.</p>
        <p>The weighted moving average option uses weights shaped as an isosceles 
        triangle where the central point (or points in an even sized window) 
        get the maximum weight.</p>
        <p>The moving average simply weights all points in the smoothing window 
        equally.</p> 
        <p><b>Note:</b> Setting the smoothing window size to 1 turns off 
        smoothing.</dd></p>
        <dt>Window</dt>
        <dd><p>The window size used to smooth the graph. The larger the smoothing
        window size, the smoother the graph, at the cost of hiding detail.</p> 
        <p>Below a smoothing window size of 10, thinner lines are used on the 
        graph to allow more detail to be visible.</p>
        <p><b>Note:</b> Remember to press "return" or "enter" after changing 
        the number in the input box in order to see the effect of the new 
        smoothing window size.</p></dd>
        <dt>Legend</dt>
        <dd><p>Choose to display/disable the on-graph legend. The legend can be 
        moved by clicking on the graph.</p></dd>
        <dt>Negative Sequences</dt>
        <dd><p>Choose whether to plot the motif probability curve(s) for the
        negative sequences (if provided). The curve(s) are plotted as dashed
        lines, using the same color as the corresponding curve for the positive
        sequences.</p></dd>
        <dt>Zoom</dt>
        <dd>Drag a range on the graph to zoom into that section. Clicking
        "Undo Zoom" will return the view to the previously displayed part of the
        graph and clicking "Center on 0" will move the view so 0 is in the
        center.</dd>
        <dt>Download EPS</dt>
        <dd><p>Download the graph that you are currently viewing as an 
        encapsulated postscript (EPS) image. EPS images are scalable making them
        suitable for publication.</p></dd>
      </dl>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_filtering">
      <p>List only enriched motifs that meet the selected filter criteria below.</p>
      <p><b>Selected motifs are always listed</b>; deselect all motifs first by clicking on
      the "X" above the color swatches if you wish to filter all motifs.</p>
      <p>To filter on "ID" or "Name", you can enter any Javascript regular
      expression pattern.  See <a href="http://www.w3schools.com/jsref/jsref_obj_regexp.asp">here</a>
      for documentation on Javascript regular expression patterns.</p>
      <div style="float:right; bottom:0px;">[
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_sorting">
      <p>Sorting is applied after filtering where possible (the exception being
      the "Top" filter) so the filters applied will affect the sort.  You can
      choose the motif sorting feature using the "Motifs:" menu.</p> 
      <p>If CentriMo is searching for locally enriched regions (not just centrally
      enriched regions), then multiple regions may be found per motif, and
      the "Regions:" menu will also be displayed.  In this case, 
      CentriMo first sorts all regions using the feature
      shown in the "Regions:" menu, and then it sorts the highest-ranked
      region of each motif according to the feature shown in the "Motifs:" menu.
      </p>
      <p>
      Unless you check the box next to the "Regions:" menu, it will automatically 
      show the same feature as the "Motifs:"
      menu (or "<i>E</i>-value" if a motif-only feature is chosen in the "Motifs:" menu). 
      </p>
      <p>
      <b>Note:</b>The motif <i>p</i>-value shown in the plot legend will always be for
      the region with the lowest <i>p</i>-value, and therefore may not match the value
      shown in the table "<i>p</i>-value" column 
      when the "Regions:" menu is not set to "<i>p</i>-value".
      </p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_db">
      <script>print_doc_para('pop_db', 'motif-db', 'motif.');</script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_id">
      <script>
        var html2 = '<p>If more than one motif has the same ID, CentriMo uses only the first such motif.</p>';
        print_doc_para('pop_id', 'motif-id');
        document.getElementById('pop_id').insertAdjacentHTML('beforeend', html2);
      </script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_name">
      <script>print_doc_para('pop_name', 'motif-alt-id');</script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_consensus">
      <script>print_doc("pop_consensus", "motif-consensus");</script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_fisherpv">
      <p>The expected number motifs that would have least one 
        region as <b>comparatively</b> enriched for 
        best matches to the motif as the reported region in the
        <b>positive</b> sequences compared with the <b>negative</b>
        sequences.  
      </p>
      <p>
        The Fisher <i>E</i>-value is the (one-sided) <i>p</i>-value of 
	the one-sided Fisher's exact test that <b>at least</b> as many best matches 
	in the region in the positive sequences that contain at least 
	one match, multiplied by the number of motifs in the input database(s).
        The Fisher's exact test <i>p</i>-value is corrected for the number
	of regions and score thresholds tested ("Multiple Tests").
      </p>
      <p>
        Fisher's exact test assumes that the probability that the best match 
	(if any) falls into a given region is the same for all 
	positive and negative sequences.
      </p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_pvalue">
      <script>print_doc_para("pop_pvalue", "centrimo-adj-pvalue", "<p>The enrichment <i>p</i>-value of a motif is <span id='ins_pop_pvalue'></span></p>");</script>
      <script>
        if (data['options']['disc']) {
	  $("ins_pop_pvalue").innerHTML = 'calculated using Fisher\'s exact test on the enrichment of best matches in the positive sequences ("Region Matches") relative to the negative sequences ("Negative Region Matches"), corrected for the number of regions and score thresholds tested ("Multiple Tests").  The test assumes that the probability that the best match (if any) falls into a given region is the same for all positive and negative sequences.';
        } else if (data['options']['cd']) {
	  $("ins_pop_pvalue").innerHTML = 'the probability that the optimal average distance between the best site and the sequence center would be as low or lower than observed, computed using the cumulative Bates distribution.';
        } else {
 	  $("ins_pop_pvalue").innerHTML = 'calculated by using the one-tailed binomial test on the number of sequences with a match to the motif ("Sequence Matches") that have their best match in the reported region ("Region Matches"), corrected for the number of regions and score thresholds tested ("Multiple Tests").  The test assumes that the probability that the best match in a sequence falls in the region is the region width divided by the number of places a motif can align in the sequence (sequence length minus motif width plus 1).';
        }
      </script>

      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_evalue">
      <script>print_doc_para("pop_evalue", "centrimo-evalue", "<span id='ins_pop_evalue'></span>");</script>
      <script>
	$("ins_pop_evalue").innerHTML = (data['options']['cd'] ?
		"optimal average distance to the sequence center as low as observed."
		: "at least one region as enriched for best matches to the motif as the reported region.");
      </script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_MCC">
      <p>The Matthew's Correlation Coefficient (MCC) gives a measure of the ability
      of the motif to discriminate the positive sequences from the negative sequences:
      <dl>
        <dt> MCC = [TP*TN - FP*FN] / [(TP + FP) * (TP + FN) * (TN + FP) * (TN + FN)]</dt>
      </dl>
      where 
      <dl>
        <dd>TP is the number of positive sequences with a best match in the reported region,</dd>
        <dd>FP is the number of negative sequences with a best match in the reported region,</dd>
        <dd>TN is the number of negative sequences without a best match in the reported region, and</dd>
        <dd>FN is the number of positive sequences without a best match in the reported region.</dd>
      </dl>
      <p>MCC ranges from -1 to +1, where a +1 result indicates that the occurrence
      of the best match to the motif in the reported region perfectly discriminates positive
      sequences from negative sequences.
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_binw">
      <script>print_doc_para("pop_binw", "centrimo-bin-width");</script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_bin_sites">
      <script>print_doc_para("pop_bin_sites", "centrimo-sites-in-bin", "<span id='ins_bin_sites'></span>");</script>
      <script>
	$("ins_bin_sites").innerHTML = (data['options']['cd']) ? "is anywhere in the sequence." : "is in the reported region.";
      </script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_neg_bin_sites">
      <p>The number of <b>negative</b> sequences where the <b>best</b> match to
      the motif falls in the reported region. This value is rounded but the
      underlying value may contain fractional counts.</p>
      <p><b>Note:</b> This number may be less than the number of <b>negative</b>
      have a best match in the region. The reason for this is that a sequence may
      have many matches that score equally best. If <i>n</i> matches have the
      best score in a sequence, 1/<i>n</i> is added to the appropriate bin
      for each match.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_total_sites">
      <p>The number of sequences containing a match to the motif 
      <b><span id="ins_pop_total_sites1"></span></b> the <span id="ins_pop_total_sites2"></span>
      threshold ("Score Threshold").</p>
      <script>
	$("ins_pop_total_sites1").innerHTML = (data['options']['use_pvalues']) ? "below" : "above";
	$("ins_pop_total_sites2").innerHTML = (data['options']['use_pvalues']) ? "<i>p</i>-value" : "score";
      </script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_score">
      <p>This is the <span id="ins_pop_score1"></span> threshold 
        (<span id="ins_pop_score2"></span>)
        for determining if a sequence contains a match to this motif.</p>  
      <script>
	$("ins_pop_score1").innerHTML = (data['options']['use_pvalues']) ? "<i>p</i>-value" : "score";
	$("ins_pop_score2").innerHTML = (data['options']['use_pvalues']) ? "adjusted motif <i>p</i>-value" : "bits";
      </script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_neg_total_sites">
      <p>The number of <b>negative</b> sequences containing a match to the motif
      above the score threshold. When score optimization is enabled the
      score threshold may be raised higher than the minimum.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_negative_binomial">
      <p>The probability that any tested region in the <b>negative</b>
      sequences would be as enriched for best matches to this motif according
      to the Binomial test.</p> 
      <p>Use the filter to display only motifs differentially enriched in both
      datasets (low <i>p</i>-value and high negative <i>p</i>-value).</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_prob">
      <p>The maximum probability that the best match occurs at any single sequence position.
      If the smoothing window size ("Window:", to right of graph) is set to "1", then this is value is
      the maximum value of the match-probability curve.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_concentration">
      <p><b>Concentration</b> is defined as the total probability of all the positions in the central
	region whose width is the same as the size of the "smoothing window".
	You can change the size of the smoothing window using the "Window:" 
	input field in the <b>Graph</b> options section, above.</p>
      <p>The "concentration" of the motif sites in the central window
	can somtimes be more informative than the <i>E</i>-value.  For example,
	in some ChIP-seq datasets, motifs for cofactors show more significant
	enrichment overall (smaller <i>E</i>-value), but are less
	concentrated in a small (20 to 50bp) window than the motif for
	the ChIP-ed transcription factor.  In such cases, you may wish
	to sort the motifs by Concentration, using the <b>Sort</b>
	menu, below.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_nbinstested">
      <script>print_doc_para("pop_nbinstested", "centrimo-mult-tests");</script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_bin_location">
      <p>Location of the center of the most enriched region.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_SMmotifs">
      <p>The text box lists the sequence identifiers for sequences that 
      <span id="ins_pop_SMmotifs"></span> <b>all</b> the
      selected motifs.
      <script>
	$("ins_pop_SMmotifs").innerHTML = (data['options']['cd']) 
          ? "contain a match to" 
          : "have at least one of their best matches in the most significant region of";
      </script>
      <p>The "Intersection" subheading gives the number of identifiers in the
      text box and their percentage out of the total number of input sequences.</p>
      <p>The "Union" subheading lists the number and percentage of
      sequences that have at least one of their best matches in the most
      significant region of <b>any</b> of the selected motifs and their 
      percentage out of the total number of input sequences.</p>
      <p>Note that the number of sequences with a match to a given motif in
      its best region may be larger than the value of "Region Matches". This is because
      a sequence may have multiple equally best matches and in that case a
      fractional match count is assigned to each of them when "Region Matches" is computed.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_OEbins">
      <p>When more than one significant, non-overlapping region is found,
      they can be shown (and hidden again) by clicking the arrow.</p>
      <p>By default the regions are sorted by <i>E</i>-value, but this can be
      changed by the menu on the right of the page.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_problocation">
      <p>Sequence position where the (unsmoothed) match-probability curve for this motif 
      attains its maximum.  Set the smoothing window size ("Window:", to right of graph) to
      "1" to see the unsmoothed match probability curve.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <!-- Page starts here -->
    <div id="top" class="pad1">
      <div class="prog_logo big">
        <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wLGwYsOTtZCG8AAAA8dEVYdENvbW1lbnQAIEltYWdlIGdlbmVyYXRlZCBieSBHUEwgR2hvc3RzY3JpcHQgKGRldmljZT1wbm1yYXcpCgcnzvAAACAASURBVHja7Z13YBVVvsc/M3P7vSk3BVJIQiihN0MVUDpSFBAFsXcEy/pW1HXbs6xrWZ9dV11FBSuKCNK7CSUJoQYIJKT3kH57mZn3R9wgG1TePnUp8/nrkjNzuHPO9/7O+f3OOb8BDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDY0LBwGYoTXDRYkE5AmAqrXFRctrun9+qnZUXxRPbPs2A+v0mahhoQguN4FxY2j64C2UENtF0+sxITH//OgXLzbJq4cOosTE0Lzic3x/fAxd9j7CHnviojUBuovtgS2HjqLExRBI6YpvyCBCDXrMz/yN0IR4Wh59UBPABT/rPZqLGtsRzGYAWhbegZhzGNNfngWzmZYH5l9U7XFRDQECAkJeHnKneBSD/ru5sITjlb/hHz8W01+exX7zfPRllZoALkRM1XWoXi9K56TT/i6bjTR99QmeJ/+MYd0GwqdejTn7gCaAC46DB0CSkLt0PkNLCDjuuY2WbevB6cQ2Yw7mzds1AVxIGA4cBp2OQJekH7zG07cn7k1rICwU263zMezZrwngQkGfcwTVoEfo0vVHr3N1S6L+2w2oOh2Wt96FYFATwAXB4cOodjt+i/EnL1WiIghMnoBYUQmKqgngvP/1O90IzS0IPXqc3Q2qCp3i0bu9oCpaHOC8p6oK1etBGZx6lj6jgBofj1pdDYqiWYDzXumFJUg+P57+vc5aAP6YaITGRjAaNQGc70ilZSDLCH36nvU9SlgoCAKWonJNAOc7QkUFqiThTu509jeZLaghIQhHczUBnNe/fn8QQ85R6N///3SfGmJFlWUoLdUEcF7+6hGwffAJ4eOnIW3cjNK79//pfjnEhmoPR19UonkB5yNhL7+J4c9PooaF4X/rTZrmzfy/VWBrFYCxtEITwHlpATKzEEwmasuO/XsVWK0QEoJaVKQNAefduN/UjFhcijpp0r9dhyJAMCoCios1AZx3pq28CqmxCffll/6/6lHjO4HXi9EvawI4r6goh9palIkT/n/1dOgAgoCQl68J4LxBUTHk5EJiIu7O8e2K606KNDVKZ+cJxH23g7aiQhPAeYMcRJ++i0D3LhA83XR7PAKP3BfJhtWWs6oqkBCHKghIpeWaAM6b2X9QRneiAOXSESCd/og1FQZkWUT26VHPZpU3Ng5BkjBeoPsEL0gBGCtroLoaT+oAEITTylwugSum+SgqUThZrf/pSWBsDKooIlyg0cALUwDrN0NoKGrHju2nB0EdtjA/kZHwzfKfPg0UkECwWS/YWMAFKQDTtjSCneJROnZoV5a+XU/QL3HNdV4qKqG08Cx2ByUlITU2oUPSBHCuo/cFULduRe3RnWB4GHJQIBA4VV5braNzdw9Gi59x41Ty83+6CcROCaheL9TXaQI417E98DAEAnhuv56KSj2vvxBGwXETAJXlOgYNDtCtG4SEKlSUK8g+Iyerfzwi7kvpAl4v+HwYyqswf7lSE8A5afrTMzB89TXBeXPwXnopW1ZbSP/WiNP5XbkJfP4gDmfr9H/srHryD+rJ2Wf5UY/A370rkttD2KI/EnbFDGwPPYZO1GkCOKdcP7cb82t/R7VaaXnzZfJyTbhcCjfdpLBto5VgQGD3Dj15R83ExysU6gqYFT8G9x1vU17vY/OaH54QCsnJ4PMhrV6DUN8AHg9i/glNAOcS5uwDGHbuxvniswR1IscO6+nWXWHSzHoMBijKN3HssIVOyT42GVax0HgvC4IL2J7yNrV9t1JcYGTLevOZXcHkzsijR+LctBbP6y+B14tYUHhBtNsFsxxsXPYlckQknkmjqTspIcsiyd1dmC0K/foHKSoUSUkOUtX/W57Xv8hDwd8x0jcSxaxwYtRaEvPGYzQJeL0CJtPp44G3QwTeVV+h6lRM0bFYVDDk5uGdNE6zAOcKWfvCmB94kxVfR7Pi40jKysAe0dqRktGLKBtxRlazVPcR98sPMMY3Bhs2+gb74hIceGNKqCgTQBXaWwBRZKt5K0f0R0jrcZLN41XI1YaAc4ajh60szenJlKFVOINmevZ14mhRiYpuXQfo1SdIdrbMn9ZlMioyha7Bbhhp9f97BnpSL7dQMvk9jmVbyT3cGh1UVdi4KozHng3wpO45Xje+zkf6j3ja8DivPGbG66xE9Po1AfwnkBDaZuFHc6xsfa+B+8RPuWKqgRtvqyNkUia3/qm47frwUIVyXxNGVySDE8PpHezXVmbBwj3yAgp0RxBG7aH4kAk5CLJPz0dZBexw7yNtrY2Xvc+w0LOQhf75NHWNZNm4WoT65vZBIwWKThg0Afxine/2EHrNjYRPmI4MrF6vY5qcRqB3BgtnL+N18z+41XwTu8O30iA0AFBiLaDsjwuZ/1ALs71z29XZP9CPErUC57CtrDdsBsXElFXvUx6zl2FjXdxdvwh/Tl8S1AQmByYxUBqM33ESt9LYrq5VX1p57y2zJoCfiz+Z/8QH5g9w4kRGQVdQhO7gIYTdmWz7u4/OyUHqRnzNvW+35rtrFppZJC9isbiY983vc0I6wfPWZxgU04G7el1yxv/DolpI9+wgOgoqLEV0qx6Pf28/bruiA08NGk+oTeDggVMh43GmmfxjdgPVupPt6qqsEHC0SPi8p5pWQSFIEPUczMh3TnsBx3THyJfyyVAz2G3bTX95EDef0BHe2EQpCWzd2kT0u5tZVv4NY04kce/Av6N3tcbre+l78Zn+M24038gUeQoLvAsw88O/zKASZJF0O6GNejq8O4ERE3zMDk3EHB4gKgoOlonsyzLRp7+PS02TmbAplNWzMriXkQQIEhT8GHw29mWY6N8fHPUSUic/aVIa5bpysoVsbgneQrKcTIQScXEK4NB+A+HhKonJgZ+8VkHhPcN7DFBSucl3A4XiCT40fEhyoInkSCNvVC4kNOU9DsS3cP+iAFe7+1E/49RiTWogFb/qx2PwsMC7gA5qh58OJhkgPsKAuLEnMf2dWDq4ARg8wk1NjYUd28xIokhdrQ9f4UJ2vdCdkiF76XZdOsVCMfKH99F7UiIOWz07mv2s6f4UkUIUBsVAuBrOK4ZXMGPm4cDDdPN3Q0VFQPhpF7egGH9UBGpY6PktgG2bjDQ0wBPP/rQAsvXZWAQryWsOk9RFT6fEy2gQ6nk7eQEV8X+hZ3wN7ybt5LIsC1evEAn8sf2p3+HB4aQGUzFwlpMyAUZd7iPnoJ4hw07vmGkz3eQfC/LZUjNGQSSpLIz3Zn5K46E7MQ2OoigqHzXsKJkRX9LSIrC/Io4OQw084H2A2GAsKirlunLWGNcwWz+bDcIGYnwxP/mVLLVNhAwcjvcvT9D8wN3t9jec8wKQkZGQKC/VceSQkSumygguJ2J5FUpiAqrZ1N4cC0FW6FZwkMO89VQstXM203L99YyouYoty4s5On8A+XVViLM/4v5Prkfn24ErdeAZ+lM4+87/p8cQGeSxJ5rOWNa9p5/f/VlGb5Tx/b6aPl/m0HD3CKq/uoKHrrqd9X7oFyGzNXInwRWTeXDiTad9l8RgItOUaYgmkZm6mSxWF9Pb3/60kqpCY50evyDTNWMnKiDu2An33AJG0/k1CdyhS+cV9W12rzczbFiQA7kC0hNvEXX5ZAy7sk5/8ICH/boDvG98nxNSAYsrnufbrAYWvyjw0WILmZ+5SFlTzr6kN9n7yF957P5G4t5aCagoQwb/KlZMb2yNLYQPSGbaqnJi9UbscQLLV4dwsthGnz4K8xNHEFQkdm5tb7ITlUSu9V7LLfItPKd/jlyp/cFTQYC/v2rjzVciOLKsCAEwHMulIq+1/Gw3tP5HBZCbY6JJamKN4ROWfiyxOPlvdBlWS4cYhcyl5eByYyg4yqovjGxZG8KKbc2MDZ3CBuNasqQsLlFSCb52jKXMI7pyN3ODq5lt/JSH2E94r0PEKV2ZWtQPtbQYtUsX/Cb9rzmaocbEgM3GpQ0bKGswsDlNZNgoDyoqepvKhMkBMjMkREGkuFBH7hEJv6+14yKUCOb55mHCxCbDprY6C6VC7jHfxhcfRBLbUeXycR4ycmOQkXAUN+I8VMfVUyOpqzYi/0zHFCTgcYBFv1/087WOIjFqsB2/tZl1H3VioLEHoaKNzbPvxVdWimuDlR7xu3E3dMA/aTrr19nIi1pPy+PhjO14GffF3sw49xW8fFMp13XYzpQ+lcSufhdzcxNSbEdCb7yXm5TbCT1ahn7vPoTLLsN19ZW/qgAEjxfDmvUY31tM0oaldIwIMO7WaGSLEUSRpiaRELOO99+y4mwMIPgMLFtmpaTAQLhdpWO4ngQlgcWG9+ikJqEPGHjb/DY7duo4khbFbxdKOBpshL36Eo6ufZHjE/hkezJTHu3Gjm16EpIUwuz/ngpeeOaFf37c/YsIIHu3mRkzg7ynLuG6a1VKX7+SxX81Y1Pt+N44wcqZFey8009pwEzx8ZsZen8223UbuHzLEfh8GEXmS9ixTqHH5rcZMzcE7rsJw/sfIZSWEpg2gbiJd2PFht7pQv/1N7hvnod/2OBfVQCKPQxlyGDUrl2xW730P/EV5udfxphXAKqC7vgxXOv3EJq5hXFrf0/IltX0uXMw2ZXR1FWKREVCj9BoGur0PLFzO3szLaS/l8KEyhvQz1rD9h5LuCJa4t3lNuqGdGK/5zIqx+3nnoXdKGxwUXciioQuXgz/sqPNjx/pJ7aufV8Abe8LePVNN3Nuavn/m0YFDuwI4cGMlQx9YgUPehfRKdgFVZCRvD5KLn+Qj53TCV/SzMY3jyCPGkfCfcuIXbaNP92g4BfspP1pFcETlUxeegvGla/jGTeGqCvnIuzYieud13Ff23rKVzpZT8iKNTinTSQYH/sf86UFBKSiEszb0jF/8BGUlSGIAogqamISvpHDMX2wFDnSTsub77LCPRx3vY6YWD+NTUH+enwVl4xv4KqmG7hiLOQ6K3i1w5NUCw70HxaT9s3nXNOUzaplC5kUOpnwQCLeRU9y5ywT5VUSU2e4ECVIM6SRKWTyW99vf1QE30sX/z9tAnjjbQcDLgnQrefZLXB89ZmVcZP8mEwKJsspU9TshFufKabPwm9J6ubmLs+CU/7s7izCrpnLopR16Hr2ZGfNF/jfeB9dbICls90k+uLRpaXju/NOxOoq9Bs2Ut9QgazKmIsrsA0cStO+XacSPf5zG8/P7Br9++pXIRD4LqnUd99JFMGgR19YQsTEK1sbe9JEXq+eTXWtgP2OSaTctIOBxl4YldM9FvNLL2F46jnq0jKQKiux3ziHPa/dwNI7bGwpy2H8+ucZG5PCsrdsTHhzLU8l3c0oZTTPu5/HivW0upqkJp4y/DdxB6bzt8Ft3sn/tLmB+yx7qG0QCJGiiJDDKc61UVWhZ/R4Z1v7+pQgLn+AwsM2tmXIHM6xMnKEyvE8gWkzXIQmFPHi6t1Iccm4u+3nLs/Lp/ucWXsRvH6mP96TpR9KPLz5EOVf1LHnpu50TT+A88MnkDp3xrRkCaqqol51JbLaKi5P53j0f3iUYJfOtL3k5Fzp+O9P3w1ndjsDXZJo2LaOsNk3wKZN3Cutw18voyzugWfUqwRT2t9nOngcnSxiGdAdtWsMeoOFEZ9WET93Kclx/+CrO++m6vBUDPN78O6OWq5OmM02cRt7TbsoeHE2o8f4iepdzXLzcg5KB8hUM0mo6X/mOIDX3MDnNUfZGdjPDPMoWtb8hp17BAYMdhMWrtCktrC9Lp8lSyQUXQDTb9ZjcvRBFcYyREzk7xtryFV3UetQeHCWibmel0+LdAkuF8aNWwmOHIm9l55uqRYi9rQw47MYmgYtBPPd+Pv1xj+gH/ZvViM0NNBy582nfVnHw785J+PpZ0sgMZ7G9A0ITlerS7nvALb/egTz5Om4nvgjrpuv+557JiAUFCKkpBCQA2A2IfTqDQf3Eerycjt30kvXh419VrOqvI4Rzmu48dBdjOy3jE8PltCyQ6HM56B+yJ8JF+z0Dw7ggfJn+a+N1Wd2Ax8eOowrch5hiDKYJV8KHI/JYPoUH888FoEiuniy6mOefjHAkF4W7rnXy+xePdh36WtsH/4Cn8y4hxXDniU0ez/zPrEyTe7YNja24Xajz9pD4Pp5REcGmDu/hYGjTKhHsgn94DMCnRMI2qwEOkQSmHoFxMbiG3r64o16AbzeSDYZCUZFEIyKwDNpHE0Z30JiIpann0f/vUwkQkUlYn0DwZHDTzXhnbcg1ddjXLkKgBHBETzs+QPLx9xKbO5EasolbEdHUVgaILqThxOG45TmWVjgWsAdnrvY+UUCd13S58wC6BCqp3t3mcaHH8ZbFca+zl9xdOprSPO+IvmBnWz6OJprh8fyu4m9uUI/mmu9c9ji3EaFUEm9oYnHK/fz6hcZPFG4gI7Hs9o9uG3rTrBYcA8ZiE4Cm05FN6h369HrZV+gjhgOoaGg0+GeOQ153BhU6cI7iNHOKoRYcbz1CmJVFebPl5/yz2tqERsa8Q44tXfBNXcWakICpi+/RnS521YyO8vduHV+A8s+DqHy2+5E7ZvI5892o653Ov2+/gN2TwzLPwlBb1QZPkI5swBECS5PrUPK3Ml/p8zlkpFumrvsparbDuYOS+bJrtfzyMwkBMPpiZMXO99nQc2VPLCglJQUH8LYkVjeeb/9gsY77xHs2welQ3Tb37yDB4IkgdGI95IBqGKrxQgMHYxj0W/OvTH+F8LTqzvyvHmY/v4PpNq6NgEgy6gjT09w4Xzij+j2HUB//PQtafEJMtOudpCbp7JwdjxxoUam945gkD2OPz8agSCJjJjspEOs/4cjgXEFO3mleh6p4h4eEe7nLvd9vBA/n+dm92LW1f4fWj9h4gd1iE3NeN54Hfc1MxH27sNYXnUqfNrYgnjwEIHhQ057O5c8oH/rrNlkItivz2k+tq9b54tGAEDrq2ocDqzvLW3tmPoGBJ0Ob9fTU9v7JoxBtVoJff2ddnVMnOLhnodbGBus49kba3n0nk+RdmWRUyQxLTaTAV+9jCn74A8sBgWDWLZtRzpZTdJ9t1OXk0mUEolO1BE5ajTuBXfhuO369rHkhkbMy5ahjh+Pc/glGEKsYDRifuMdfM/8d6uZ+nw5KAqBy0edPh5KAq5nn0INBpB797ygkzL/FP6e3fFdOwvzcy9gWrEKtbISevVC/Zfj7XJ4KL47bsH0xNPonnmcYMeo08qj7Cqhtz3CDVtAiDjODZun0FMYSmLaTlAU5Icf/IEhwOFEt3I1crduCEVFWF98HQD7xKsgNxfzQ48S/sifEevqT/dVt6Yj5uXjfPg3rQ/SpwfBgf0xvL8EndCqL/0HS1FjY/CPap+vx7XwTtwPLEC5iDu/1eaLeG69kcDgSwjqROROcXh/ILrpmTIBwsMI+c3D7crMOzMR0nYQvOsOakpyke65keHDnAT+6wGCvXpgKyg9swUwZh9AdLtp/vJjbIt+j/HNt9FnZSPu2oXrb38FfwDr088RsWMXjrdexde/N8aCYqz3Pkhg/Fjcg08tx/pvuA7dtm8Jvete/JMnIOTlE7x+LrKIxo9ZgaGpNGz+5qcnjr164L9qOsYPlmLO3ItnWOteCMHnx7h4CWJ0NA1P/aE1APS3v7TdZ6+oQN2V2W4IVwGCl41G9XpoXPEpereX8MGjUJubkZ96gvoH54OqYjici/3Ka1GNRlxffIzltrtRT56kees6At2ST6s48vHn0L31DorXiyDLONM24x7UV+vlnwmd20tEcm/ky0bRuGwJigCGvELsQ0bhfe1lmm+e094Te/wZrK+8gXDqDSj/c2oISEvHN34MSmgIvphoPA8sRLlyOvX339kW5fL3601D2kYArCPHIuTl4/nL4+06H6D+8UdpPH6QwNxrELp21Tr/ZyZoMeF/dBG6jCz06bvQF5YQftd9qD174ph25sxoQlJSq9d1Jgsg22y0bF6Dr0/rGzVEtwdBVpBDrO0qMhw5RvjsG5CHD6Xhg7d+MkCjb3YSCLNpvfZzTxuCClEDhiPbw5Hy8pE7RON66Tk8E8ee8XrL1nSs825BcrvbrwUIyZ3bOh9AsfzwDlp/n540fv0pcmLCWUXntM7/haKKOhH3ow9hfuC3BOfOoelPDyN3ivvRULRq0IP7DBagvjSPgD1Ua9XzzQrU1qEvLcc7sC/ofnyLpz4gE5YyAF1dXXsLoHX+eWoFOkQhd4g6q2sDegk1PAxOCQDNMbvIEPr1O3MgSOMi8R5SumkCuJjx9eutCeBiRu2jCeDitgDJiZoALmoL8C+ri5oALnI0AWgC0NAEoKEJQEMTwK+Kx+OhqrKK5sZm1q9eT0Z6Bk0NTWxYvYGKsgr8Pj8b126kuKCY+pP1bFi9AUeLg/qT9axbtQ6P23PGeutP1rNp3SYEBERBZNPaTdT/yza2qsoqcg/nosoqu9J2AVBe/OPvBDqQfYCW5hYydmRQmHfmNLGCKrDum3U0NTRRW1MLwJGcIzTUN5C1O4uc/TnnnAD+Y0mimuqbWPXFKm6/73aGXTqM2upa1q9az3W3XkdxQTEbvtnAtKunsS9rHy0NLUycOpHtm7Zjs9mYPH0y+zL2MWjYILJ2ZiEKIsNGDwNgd9pups+eTnZWNo4WBxOnTmT9yvWYrCa6dO1CXEIc1RXV1NXUUV5STr+B/cjYkcHK5St55qVnqK2qpbKykpiYGFxOF117dAWgIK+AohNFjJkwhqyMLLqkdGHrxq04WhzMuGYGAEdzjpI6OJXCvEKWf76cp196msqSSvSSnrUr13LH/Dvant+6ah3qWb6V3P27315YAlBVldwjuZSXl1NbWYstzIaiKIRHhHMg+wB5x/KIT4gnNyeXDas3MOeGOTTUNWAxWdAb9aRvSae6uprO3Ttjtpg5cugIiqJQXV2NoAosfWcp8cnx9O3XlyVvL6HwRCFxCXHU1dYRciQEi8UCIugkHau+WsWU6VMYMWoEABXlFeTn5rNpzSYGpA4g/dt0xk4YS+buTCZNncT6b9azf+9+Jk+fTDAQxOVykXs4l11pu5g1ZxY5B3MoPF6IyWIiOyObupo6GhsamXXtLDJ2ZJCQnACAZdsO+OqrHzxL+GsJoG0/QLWj+lcVQUVpBfEJ8ZQUl5CUnERjQyNetxeH04HJaCIkJIT6+noUWSEiKoKa6hr0ej2hYaG4HC4UFEJCQyjMKyQyKhJ7hB2vz4vJYKKhsYG4TnEoQYXqqmpCw0LxeDyEhoYSHRNNTVUNzY3NhIaH4mhxEBsfS211LZ0SO5GXm4fZYqa2ppbUoalUlFUQ3TGaksISOsZ2pLmpGVEUkSQJWZaRFZmo6Cjq6+oxGAz4vX6iO0bj9XrpENOBkoISwuxhVJZXEhIWQkJSqwB09Y3gcp3V2YdgQvzP2vbfPx7+q1mAuto60ramMW3WNDat3YTRaCTcHk7+sXzKS8sZedlIDhUfov8l/Sk4XsD2LduZNXcWJ46fYG/WXsZNHode3z4NTFlxGW6Xmx59elBcWMzRI0cZM3FMW3l4ZDiH9h/CarMSHRPN4UOHiYiIwOV2kdI7hZjvXgxp++7ASp/+fWhpaWH/3v306deHE/knSEhIIPdoLm6Pm9ShqYhi+6mT3+cnLCyMNavWMHTEUOTvcrjU1ddhNBsxGow01je2CSAYaYdI+8UzB9ixaQdXzrmS+tp6PG4PqUNT2bhmI4OHDEZn0pGRnsHuHbvp1bcXNRU1jJs8jvxj+Zw4doI+A/qgyApe2cuqL1Yxetxo7JF26mrrsNvtHDpwiEFDB2E2mqmprsHV7GL9mvVcNv4y7BF2SgpK6JrSlU8Xf4ov6GPwkMFUlVUxaPAgyovLKSwoxGwx069/P0xWE2UFZVx19VV8tuQzRl42kq2btjL1qqkU5hUiiiKfL/mcjnEdGTJ8CJJOoqW5hXWr19Gvbz8C3gAmo4lnH3+Wv77yV+qq6zAajGxev5nUwadS2S03LqdRbUREJJJIDnCAoQxlN7sZwhAqqMCMmTDCmOmfef4LQG/Sk3s4l4iICMpKyji07xDxneLZv28/zhYnOr2OpK5JrFmxhsjISLZv2o4kSQiCQGV5JRGREaio+Pw+9mfup76xnqioKFRZJSM9g/FXjKeosIigP0ja9jRqKmsoLiimoa6BQDDAyZqTmGwmSo6W4HA48Pq8NNQ30NTYRNrmNGwhNvQGPUdzjhIfH8/iNxczcsxIqiqrMFvN7Nm5h0HDBuFyupCDMik9U/h86efo9DqunXct/Qb0w2a10aVbF9atXEdcQhwFeQV4fV58fh82q42qylPH5UrFUqqEKiQk3LjZz37iiGMf+4ghhnzysWEjmmj4BZOS/2pzgObGZhwOBxGREQSCAcLCwtrcM1FoNan2SDulxaWEhYW1JohQ1dZO9/roENMBr8fLpnWbGD95PF6PF71ej6RrHYsFQSAYDKKqKmazGWeLk4joCPR6PSerT2I0GwkNC6W5qRmdXofX7cXv8+P3+7HZbHi8ntZ5hNeLs8VJaHgoer0el8tFZGQkLc0tREVHcXDvQeKT4rHarDQ3NiMIAhFREXi9XgQEHC0Owu3hyIqMxWLhZM1JbCE2fF4fKir2iFaz7xbcKCjf+eIifvwYMeLDhwEDMnKrK4uIRbX8YnOAX1QAjQ2NbFq7ialXTqWqqoqIqAjCwsPITM+kxdHC2PFj2bJpC1arldFjR7Nn9x6Gjx7O0ZyjHNp/iOtuvo4jB49QeKKQSdMnYTS2f8dfdmY2HqeH0eNHk388n+ITxUycNvG0a7J2ZREZHUlpUSlms7nt8/gp43/wux87coy4TnFsWL2B6TOms3vnbrr36E5C54T2Xo2iUlZSRqekTuQfz6djx46kb0tH0klYrVbiYuPIPZZLIBBg2lXTMFlM/9Fx//sC+GXSxH3Hzu07mXHNDMpKy8ja3eqvHz9ynJQez1wLzgAAAv1JREFUKcQlxJGdmU3Pnj0Jt4eTsz+H9G3ppA5JpaSghKGXDqXoRBFlJWWkDkvFZDIRCAZY9cUqTGYTsizjcXsw6UwcOXyEvgP7IqgCB/cepGPHjnyz/BvC7eGtnZlzDLPZTHh4OAf2HiAqMoqq0ip6DehFWVEZ6dvSqa6qxh5ux+V24ff5+ccb/2DCpAmEhISQeziXkuIS7HY7HWM78sn7n9DS3ILBYMDr9eLxeNiyYQs9e/bkjZffYMpVU7CYLZjNZqrLqhF1ImMnjqW8qJye/XoC8OE7ocgBicMHdez61srxowa8bj3794nsTrNRUqjD1WwiO1ugRy/5Z+2X72cJ+0XnABaLhQ1rNhCfGI/T4aSxsRF7uJ3jx45TUlxCYlIiWRlZ+L1+zBYzYyeN5ctPvqRTQie2btja1tHZGdmMmTAGFZXq6mryjuRxsu4kEREROFuciKJIWWkZzmYn5eXlHD18lOaGZpobW1225uZmbI02nA4ndSfrcLQ4aGxspLK8ktraWo7lHEOQBELDQjm07xBzbppD3/59cbvdpG1NI3VIKmu/WUvnLp05efIkgiDQuUtn1q5c2zYHSOmVgmSQGDR4EACZOzO55sZryPg2gxB7CCuXrWTC1AnfG3slQD4tICsAAiKCKiIgAiKq8ssekf9Fh4BgIIjX68VkMiErMjqdDkEQ8Lg9CGJrqFZRFARBQBRFjCYjTocTvV6PoiiIooiqqgSDQSxWC16vl+yMbC697FKCgWDbuC9KrX65qrReazQaCQQCGI1GREnE7XIjSRLBYOs9Or0ORVZwOVwEg0HCI8Lb7gsGgxhNRnxeH3q9Hq/Xi9FoxOvzYtQbKcwvpHP3zuh0Ovw+P4IgtN4nB1uv93gxmU1tz+1xe5B0EsFA6zOcapvWBGKq+l2yM6E1JKCq3/XId/9GBUn3yw0BujP8UUNbDNLQBKBxMWAVAJPWDhclAhDQmkFDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0ND4wLjfwE9VJhuBfJALAAAAABJRU5ErkJggg==" alt="CentriMo Logo">
        <h1>CentriMo</h1>
        <h2>Local Motif Enrichment Analysis</h2>
      </div>
      <p>
        For further information on how to interpret these results please access
        <a href="http://meme-suite.org/doc/centrimo-output-format.html">http://meme-suite.org/doc/centrimo-output-format.html</a>.</br>
        To get a copy of the MEME software please access 
        <a href="http://meme-suite.org">http://meme-suite.org</a>. 
      </p>
      <p>If you use CentriMo in your research, please cite the following paper:<br />
        <span class="citation">
          Timothy L. Bailey and Philip Machanick, 
          &quot;Inferring direct DNA binding from ChIP-seq&quot;, 
          <i>Nucleic Acids Research</i>, <b>40</b>:e128, 2012.
          <a href="http://nar.oxfordjournals.org/content/40/17/e128">[full text]</a>
        </span>
      </p>
    </div>
    <!-- navigation -->
    <div class="pad2">
      <a class="jump" href="#graph_sec">Motif Probability Graph</a>
      &nbsp;&nbsp;|&nbsp;&nbsp;
      <a class="jump" href="#data_sec">Enriched Motifs</a>
      &nbsp;&nbsp;|&nbsp;&nbsp;
      <a class="jump" href="#inputs">Input Files</a>
      &nbsp;&nbsp;|&nbsp;&nbsp;
      <a class="jump" href="#info_sec">Program information</a>
      &nbsp;&nbsp;|&nbsp;&nbsp;
      <a class="jump" href="centrimo.tsv">Results in TSV Format</a>&nbsp;<span id="results_help"></span>&nbsp;<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAQCAMAAAAyEe/dAAAACVBMVEX//wAAAAD////s2cV/AAAAdUlEQVQYlXVRBxLAIAhL+P+jC2HZhXcBZEWEldDsZcLIcAhHWWnK8SDcWQhMFUHdAQ1CqQ5+CWPmlHojl+nCJNRtzu4qRc3IUzmTVpXYK0nox0z0PI1stgchdK7lEv7ekhvalw8WW547Gyzedt/2/gLx8WXjXF/1AYFriNAWAAAAAElFTkSuQmCC" alt="NEW" id="new_1">
      &nbsp;&nbsp;|&nbsp;&nbsp;
      <a class="jump" href="site_counts.txt">Sequence position vs. number of matches for each motif</a>&nbsp;<span id="sites_help"></span>&nbsp;<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAQCAMAAAAyEe/dAAAACVBMVEX//wAAAAD////s2cV/AAAAdUlEQVQYlXVRBxLAIAhL+P+jC2HZhXcBZEWEldDsZcLIcAhHWWnK8SDcWQhMFUHdAQ1CqQ5+CWPmlHojl+nCJNRtzu4qRc3IUzmTVpXYK0nox0z0PI1stgchdK7lEv7ekhvalw8WW547Gyzedt/2/gLx8WXjXF/1AYFriNAWAAAAAElFTkSuQmCC" alt="NEW" id="new_2">
      <script>
        make_help_button($("results_help"), "pop_results");
        make_help_button($("sites_help"), "pop_sites");
      </script>
    </div>
    <!-- alert the user when their browser is not up to the task -->
    <noscript><h1 style="color:red">Javascript is required to view these results!</h1></noscript>
    <h1 id="html5_warning" style="color:red; display:none;">Your browser does not support canvas!</h1>
    <script>
      if (!window.HTMLCanvasElement) $("html5_warning").style.display = "block";
    </script>
    <h2 class="mainh pad2">Results</h2>
    <div class="box">
      <span id="ins_desc"></span>
      <!-- write out the job description -->
      <script>
        if (data['job_description']) {
          var node = $("ins_desc");
          while (node.firstChild) node.removeChild(node.firstChild);
          var header = document.createElement("h4");
          header.id = "description";
          header.appendChild(document.createTextNode("Description"));
          node.appendChild(header);
          var paragraphs = data['job_description'].split("\n\n");
          for (var i = 0; i < paragraphs.length; i++) {
            var p = document.createElement("p");
            var lines = paragraphs[i].split("\n");
            for (var j = 0; j < lines.length; j++) {
              if (j != 0) p.appendChild(document.createElement('br'));
              p.appendChild(document.createTextNode(lines[j]));
            }
            node.appendChild(p);
          }
        }
      </script>
      <div>
        <div style="float:left; width:70%">
          <h4 id="graph_sec">Motif Probability Graph 
            (<span id="ins_score2"></span>)&nbsp;
            <div class="help" onclick="help_popup(this, 'pop_prob_graph')"></div>
          </h4>
          <script>
            var compare1 = (data['options']['use_pvalues']) ? "motif <i>p</i>-value &le; " : "motif score &ge; ";
	    var score = (data['options']['optimize_score']) ? "optimal Score Threshold for given motif" : data['options']['score'];
            var compare2 = (data['options']['use_pvalues']) ? " &le; " : " &ge; ";
            var thresh = data['options']['score'];
            $("ins_score2").innerHTML = compare1 + score + (data['options']['optimize_score'] ? compare2 + thresh : "");
          </script>
          <div class="graph_box">
            <div id="pop_peak" class="pop_graph_peak"></div>
            <canvas id="graph" width="700" height="400"></canvas>
          </div>
        </div>
        <div class="graph_options_section">
          <h4 id="graph_sec">Options</h4>
          <h5>Plotting&nbsp;<div class="help" onclick="help_popup(this, 'pop_plotting')"></div></h5>
          <div style="max-height:200px; min-height:100px; overflow-y: auto;">
            <table class="graph_list" id="graph_list"><tbody></tbody></table>
          </div>
          <div id="unused_colours_section">
            <h5>Unused Colors&nbsp;<div class="help" onclick="help_popup(this, 'pop_unused_colours')"></div></h5>
            <span id="unused_colours"></span>
          </div>
          <h5>Graph&nbsp;<div class="help" onclick="help_popup(this, 'pop_graph')"></div></h5>
          <div>
            <label for="plot_type">Smoothing:</label>
            <!-- <select id="plot_type" onchange="recreate_table=true; make_MP_graph(); recreate_table=false">-->
            <select id="plot_type" onchange="make_MP_graph('smoothing');">
              <option value="0">Moving Average</option>
              <option value="1" selected>Weighted Moving Average</option>
            </select>
          </div>
          <div>
            <label for="windo">Window:</label>
            <input type="number" style="min-width:40px;" id="windo" 
            onkeypress="num_keys(event)"
            onchange="make_MP_graph('window'); get_central_probability(); make_CEM_table()" value="20" size="2" step="1" min="1">
            <!-- onchange="recreate_table=true; make_MP_graph(); recreate_table=false" value="20" size="2" step="1" min="1"> -->
          </div>
          <div>
            <label for="legend">Legend:</label>
            <select id="legend" onchange="make_MP_graph('legend')">
              <option value="0">Disabled</option>
              <option value="1" selected>Enabled (click on graph to move)</option>
            </select>
          </div>
          <div>
            <label for="plot_distance">X-axis:</label>
            <select id="plot_distance" onchange="make_MP_graph('x-axis')">
              <option value="0">Position of Best Site in Sequence</option>
              <option value="1">Distance of Best Site from Sequence Center</option>
            </select>
          </div>
          <div id="CB_show_plot_negative">
            <label for="plot_negative">Negative sequences:</label>
            <select id="plot_negative" onchange="make_MP_graph('plot-negative')">
              <option value="0">Not plotted</option>
              <option value="1" selected>Plotted as dashed line</option>
            </select>
          </div>
          <div>
            <label>Zoom:</label>
            <input type="button" id="zoom_out" value="Undo Zoom"/>
            <input type="button" id="zoom_center" value="Center on 0"/>
          </div>
          <div style="margin-top:10px;"> 
            <form id="eps_form" method="post" action="">
              <script>$("eps_form").action = site_url + "/utilities/save_generated_file";</script>
              <input type="hidden" name="name" value="centrimo.eps">
              <input type="hidden" name="mime_type" value="application/postscript">
              <input type="hidden" id="eps_content" name="content" value="">
              <input type="submit" onclick="download_eps()" value="Download EPS (for publication)">
            </form>
          </div>
        </div>
      </div>
      <div>
        <div style="float:left; width:70%">
          <h4 id="data_sec">Enriched motifs (<i>E</i>-value &le; 
            <span id="ins_ethresh"></span> using 
            <span id="ins_test"></span> )
          </h4>
          <script>
            $("ins_ethresh").innerHTML = data['options']["ethresh"];
            $("ins_test").innerHTML = (data['options']['cd'] ? "the cumulative Bates distribution" : ((data['options']['disc']) ? "Fisher's exact test" : "the binomial test"));
          </script>
          <table class="motifs hide_db hide_maxprob hide_tsites" id="motifs">
            <thead>
            <tr align="center">
              <th class="deselect" onclick="clear_selection()" 
                title="clear selection">&#x2612;</th>
              <th class="col_db">Database&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_db')"></div></th>
              <th class='col_id'>ID&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_id')"></div></th>
              <th class="col_name">Alt ID&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_name')"></div></th>
              <th class="col_consensus">Consensus&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_consensus')"></div></th>
              <th class="col_concentration">Concentration&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_concentration')"></div>&nbsp;<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAQCAMAAAAyEe/dAAAACVBMVEX//wAAAAD////s2cV/AAAAdUlEQVQYlXVRBxLAIAhL+P+jC2HZhXcBZEWEldDsZcLIcAhHWWnK8SDcWQhMFUHdAQ1CqQ5+CWPmlHojl+nCJNRtzu4qRc3IUzmTVpXYK0nox0z0PI1stgchdK7lEv7ekhvalw8WW547Gyzedt/2/gLx8WXjXF/1AYFriNAWAAAAAElFTkSuQmCC" alt="NEW" id="new_3"></th>
              <th class='col_evalue'><i>E</i>-value&nbsp;<div class="help" 
                    onclick="help_popup(this, 'pop_evalue')"></div></th>
              <th class='col_fisherpv'>Fisher <i>E</i>-value&nbsp;<div class="help" 
                    onclick="help_popup(this, 'pop_fisherpv')"></div></th>
              <th class="col_pvalue"><i>p</i>-value&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_pvalue')"></div></th>
              <th class="col_negative_binomial">Negative <i>p</i>-value&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_negative_binomial')"></div></th>
              <th class="col_MCC">MCC&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_MCC')"></div></th>
              <th class="col_blocation">Region Center&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_bin_location')"></div></th>
              <th class='col_bwidth'>Region Width&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_binw')"></div></th>
              <th class="col_bsites">Region Matches&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_bin_sites')"></div></th>
              <th class="col_tsites">Sequence Matches&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_total_sites')"></div></th>
              <th class="col_negbsites">Negative Region Matches&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_neg_bin_sites')"></div></th>
              <th class="col_negtsites">Negative Sequence Matches&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_neg_total_sites')"></div></th>
              <th class="col_maxprob">Max Probability&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_prob')"></div></th>
              <th class="col_problocation">Max Probability Location&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_problocation')"></div></th>
              <th class="col_nbinstested">Multiple Tests&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_nbinstested')"></div></th>
              <th class="col_score">Score Threshold&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_score')"></div></th>
              <th class="col_OEbins">Other Regions&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_OEbins')"></div></th>
            </tr>
            </thead>
            <tbody>
            </tbody>
          </table>
        </div>
        <div style="float:right; width:30%">
          <div id="seq_area">
            <h4>Matching sequences (out of <span id="ins_seqN"></span>) 
              <div class="help" onclick="help_popup(this, 'pop_SMmotifs')"></div></h4>
            <script>$("ins_seqN").innerHTML = data['sequence_db']['count'];</script>
            <h5>Union: <span id="matching_union_number">0</span> sequences 
              (<span id="matching_union_percentage">0</span>%).</h5>
            <h5>Intersection: <span id="matching_intersection_number">0</span>
              sequences (<span id="matching_intersection_percentage">0</span>%).</h5>
                    <textarea id="matching_intersection_sequences" rows="10" cols="50" readonly></textarea>
                    </div>
          <h4>Filter &amp; Sort</h4>
          <h5>Filters&nbsp;<div style="margin-top:5px;" class="help" 
              onclick="help_popup(this, 'pop_filtering')" ></div></h5>
          <div id="filters">
            <div >
              <input type="checkbox" id="filter_on_top" value="1" 
              onclick="toggle_filter(this, 'filter_top')">
              <label for="filter_top" 
                onclick="enable_filter('filter_on_top', 'filter_top')">Top</label>
              <input type="number" id="filter_top" value="10" size="4" min="1" step="1"
              onkeypress="num_keys(event); update_filter(event)" disabled>
            </div>
            <div >
              <input type="checkbox" id="filter_on_db" value="1" 
              onclick="toggle_filter(this, 'filter_db')">
              <label for="filter_db" 
                onclick="enable_filter('filter_on_db', 'filter_db')"
                >Database is</label>
              <select id="filter_db" disabled>
                <script>
                  var filter_db = $("filter_db");
                  filter_db.options.length = 0;
                  for (var i = 0; i < data['motif_dbs'].length; i++) {
                    var db = data['motif_dbs'][i];
                    filter_db.add(new Option(db['name'], i));
                  }
                </script> 
              </select>
            </div>
            <div >
              <input type="checkbox" id="filter_on_id" value="1" 
              onclick="toggle_filter(this, 'filter_id')">
              <label for="filter_id" 
                onclick="enable_filter('filter_on_id', 'filter_id')"
                >ID matches</label>
              <input type="text" id="filter_id" value=".*" size="12" 
              onkeypress="update_filter(event)" disabled>
            </div>
            <div >
              <input type="checkbox" id="filter_on_alt" value="1" 
              onclick="toggle_filter(this, 'filter_alt')">
              <label for="filter_alt"
                onclick="enable_filter('filter_on_alt', 'filter_alt')"
                >Alt ID matches</label>
              <input type="text" id="filter_alt" value=".*" size="12" 
              onkeypress="update_filter(event)" disabled>
            </div>
            <div >
              <input type="checkbox" id="filter_on_evalue" value="1" 
              onclick="toggle_filter(this, 'filter_evalue')">
              <label for="filter_evalue"
                onclick="enable_filter('filter_on_evalue', 'filter_evalue')"
                ><i>E</i>-value &le;</label>
              <input type="text" id="filter_evalue" value="1" size="7" 
              onkeypress="update_filter(event)" disabled>
            </div>
            <div id='cb_filter_on_fisherpv' >
              <input type="checkbox" id="filter_on_fisherpv" value="1" 
              onclick="toggle_filter(this, 'filter_fisherpv')">
              <label for="filter_fisherpv"
                onclick="enable_filter('filter_on_fisherpv', 'filter_fisherpv')"
                >Fisher <i>E</i>-value&le;</label>
              <input type="text" id="filter_fisherpv" value="1" size="7" 
              onkeypress="update_filter(event)" disabled>
            </div>
            <div >
              <input type="checkbox" id="filter_on_binwidth" value="1" 
              onclick="toggle_filter(this, 'filter_binwidth')">
              <label for="filter_binwidth"
                onclick="enable_filter('filter_on_binwidth', 'filter_binwidth')"
                >Region Width &le;</label>
              <input type="number" id="filter_binwidth" value="200" size="7" 
              min="1" onkeypress="num_keys(event); update_filter(event)" disabled>
            </div>
            <div id='CB_filter_on_negbintest'>
              <input type="checkbox" id="filter_on_negbintest" value="1" 
              onclick="toggle_filter(this, 'filter_negbintest')">
              <label for="filter_negbintest"
                onclick="enable_filter('filter_on_negbintest', 'filter_negbintest')"
                >Negative set <i>E</i>-value &ge;</label>
              <input type="text" id="filter_negbintest" value="1" size="7" 
              onkeypress="update_filter(event)" disabled>
            </div>
          </div>
          <div style="margin: 5px 0;">
            <h5>Sort&nbsp;<div class="help"
                onclick="help_popup(this, 'pop_sorting')"></div></h5>
            <div>
              <label for="motif_sort">Motifs:&nbsp;&nbsp; </label>
              <select id="motif_sort"></select>
            </div>
            <div id="box_peak_sort">
              <input type="checkbox" id="allow_peak_sort" value="1" 
              onclick="toggle_filter(this, 'peak_sort')">
              <label for="peak_sort" 
                onclick="enable_filter('allow_peak_sort', 'peak_sort')"
                >Regions: </label>
		          <select id="peak_sort" disabled></select>
            </div>
            <script>populate_sort_lists();</script>
          </div>
          <div>
            <input type="button" value="Update" onclick="make_CEM_table()">
          </div>
          <h4>Columns to display</h4>
          <div >
            <input type="checkbox" id="show_db" value="1" 
            onclick="toggle_column('hide_db')">
            <label for="show_db">Show Database</label>
          </div>
          <div >
            <input type="checkbox" id="show_id" value="1" 
            onclick="toggle_column('hide_id')" checked>
            <label for="show_id">Show ID</label>
          </div>
          <div >
            <input type="checkbox" id="show_name" value="1" 
            onclick="toggle_column('hide_name')" checked>
            <label for="show_name">Show Alt ID</label>
          </div>
          <div >
            <input type="checkbox" id="show_consensus" value="1" 
            onclick="toggle_column('hide_consensus')" checked>
            <label for="show_consensus">Show Consensus</label>
          </div>
          <div >
            <input type="checkbox" id="show_concentration" value="1" 
            onclick="toggle_column('hide_concentration')" checked>
            <label for="show_concentration">Show Concentration</label>
          </div>
          <div >
            <input type="checkbox" id="show_evalue" value="1" 
            onclick="toggle_column('hide_evalue')" checked>
            <label for="show_evalue">Show <i>E</i>-value</label>
          </div>
          <div >
            <input type="checkbox" id="show_pvalue" value="1" 
            onclick="toggle_column('hide_pvalue')">
            <label for="show_pvalue">Show <i>p</i>-value</label>
          </div>
          <div id='cb_show_fisherpv'>
            <input type="checkbox" id="show_fisherpv" value="1" 
            onclick="toggle_column('hide_fisherpv')" checked>
            <label for="show_fisherpv">Show Fisher <i>E</i>-value</label>
          </div>
          <div id='CB_show_MCC'>
            <input type="checkbox" id="show_MCC" value="1" 
            onclick="toggle_column('hide_MCC')">
            <label for="show_MCC">Show Matthew's Correlation Coefficient</label>
          </div>
          <div id='CB_show_blocation'>
            <input type="checkbox" id="show_blocation" value="1" 
            onclick="toggle_column('hide_blocation')" checked>
            <label for="show_blocation">Show Region Center</label>
          </div>
          <div >
            <input type="checkbox" id="show_bwidth" value="1" 
            onclick="toggle_column('hide_bwidth')" checked>
            <label for="show_bwidth">Show Region Width</label>
          </div>
          <div >
            <input type="checkbox" id="show_bsites" value="1" 
            onclick="toggle_column('hide_bsites')" checked>
            <label for="show_bsites">Show Region Matches</label>
          </div>
          <div >
            <input type="checkbox" id="show_tsites" value="1" 
            onclick="toggle_column('hide_tsites')">
            <label for="show_tsites">Show Sequence Matches</label>
          </div>
          <div id='CB_show_negative_binomial'>
            <input type="checkbox" id="show_negative_binomial" value="1" 
            onclick="toggle_column('hide_negative_binomial')">
            <label for="show_negative_binomial">Show Negative <i>p</i>-value</label>
          </div>
          <div id='CB_show_negbsites'>
            <input type="checkbox" id="show_negbsites" value="1" 
            onclick="toggle_column('hide_negbsites')" checked>
            <label for="show_negbsites">Show Negative Region Matches</label>
          </div>
          <div id='CB_show_negtsites'>
            <input type="checkbox" id="show_negtsites" value="1" 
            onclick="toggle_column('hide_negtsites')">
            <label for="show_negtsites">Show Negative Sequence Matches</label>
          </div>
          <div >
            <input type="checkbox" id="show_maxprob" value="1" 
            onclick="toggle_column('hide_maxprob')">
            <label for="show_maxprob">Show Max Probability</label>
          </div>
          <div >
            <input type="checkbox" id="show_hpeak" value="1" 
            onclick="toggle_column('hide_hpeak')">
            <label for="show_hpeak">Show Max Probability Location</label>
          </div>
          <div >
            <input type="checkbox" id="show_nbinstested" value="1" 
            onclick="toggle_column('hide_nbinstested')">
            <label for="show_nbinstested">Show Multiple Tests</label>
          </div>
          <div>
            <input type="checkbox" id="show_score" value="1" 
            onclick="toggle_column('hide_score')" checked>
            <label for="show_score">Show Score Threshold</label>
          </div>
        </div>
        <div style="clear:both"></div>
      </div>
    </div>
    <h2 id="inputs" class="mainh pad2">Input Files</h2>
    <div class="box">
      <h4>Alphabet</h4>
      <span id="bg_source"></span>
      <div class="pad" id="alpha_bg"></div>
      <script>
        $("bg_source").appendChild(make_background_source("Background source", data.options['bfile']));
        $("alpha_bg").appendChild(make_alpha_bg_table(centrimo_alphabet));
      </script>
      <h4>Sequences</h4>
      <table class="inputs">
        <tr><th>Database</th><th>Source</th><th>Sequence Count</th></tr>
        <tr>
          <td id="ins_seq_name"></td>
          <td id="ins_seq_source"></td>
          <td id="ins_seq_count"></td>
        </tr>
      </table>
      <script>
      {
        var db = data['sequence_db'];
        $("ins_seq_name").innerHTML = db['name'];
        $("ins_seq_source").innerHTML = db['source'];
        $("ins_seq_count").innerHTML = db['count'];
      }
      </script>
      <div id='neg_seq_input'>
      <h4>Negative sequences</h4>
      <table class="inputs">
        <tr><th>Database</th><th>Source</th><th>Sequence Count</th></tr>
        <tr>
          <td id="ins_negseq_name"></td>
          <td id="ins_negseq_source"></td>
          <td id="ins_negseq_count"></td>
        </tr>
      </table>
      </div>
      <script>
      {
        if (data['options']['neg_sequences']) {
          var db = data['negative_sequence_db'];
          if (!db['name']) db['name'] = name_from_source(db['source']);
          $("ins_negseq_name").innerHTML = db['name'];
          $("ins_negseq_source").innerHTML = db['source'];
          $("ins_negseq_count").innerHTML = db['count'];
        }
        else {
          $('neg_seq_input').style.display='none';
        }
      }
      </script>
      <h4>Motifs</h4>
      <table id="motif_dbs" class="inputs">
        <thead>
          <tr><th>Database</th><th>Source</th><th>Motif Count</th></tr>
        </thead>
        <tbody></tbody>
      </table>
      <script>
      {
        var tbl = $('motif_dbs');
        var tbody = tbl.tBodies[0];
        while (tbody.rows.length > 0) {
          tbody.deleteRow(0);
        }
        var motif_dbs = data['motif_dbs'];
        for (var i = 0; i < motif_dbs.length; i++) {
          var db = motif_dbs[i];
          var row = tbody.insertRow(tbody.rows.length);
          add_text_cell(row, db['name']);
          add_text_cell(row, db['source']);
          add_text_cell(row, db['count']);
        }
      }
      </script>

      <h4>Other Settings</h4>
      <table id="tbl_settings" class="inputs hide_advanced">
	<tr>
	  <th>Objective Function</th>
	  <td id="opt_obj"></td>
	</tr>
	<tr>
	  <th>Convert Motifs to Different Alphabet?</th>
	  <td id="opt_xalph"></td>
	</tr>
	<tr>
	  <th>Motif Pseudo-Counts</th>
	  <td id="opt_motif_pseudo"></td>
	</tr>
	<tr>
	  <th>Required sequence length</th>
	  <td id="opt_seqlen"></td>
	</tr>
	<tr>
	  <th>Site Scoring Method</th>
	  <td id="opt_use_pvalues"></td>
	</tr>
	<tr>
	  <th>Score Threshold</th>
	  <td id="opt_score"></td>
	</tr>
	<tr>
	  <th>Optimize Score Threshold?</th>
	  <td id="opt_optimize_score"></td>
	</tr>
	<tr>
	  <th>Minimum Region Size</th>
	  <td id="opt_minreg"></td>
	</tr>
	<tr>
	  <th>Maximum Region Size</th>
	  <td id="opt_maxreg"></td>
	</tr>
	<tr>
	  <th>Strand Handling</th>
	  <td id="opt_strands"></td>
	</tr>
	<tr>
	  <th>Plotting of Matches on Negative Strand</th>
	  <td id="opt_flip"></td>
	</tr>
	<tr>
	  <th>Sequence IDs Included in Output?</th>
	  <td id="opt_noseq"></td>
	</tr>
	<tr>
      </table>
      <script> make_other_settings(); </script>

    </div>

    <div id="info_sec" class="bar">
      <div class="subsection">
        <a name="version"/>
        <h5>CentriMo version</h5>
        <span id="ins_version"></span>
        (Release date: <span id="ins_release"></span>)
        <script>
          $("ins_version").innerHTML = data["version"];
          $("ins_release").innerHTML = data["release"];
        </script> 
      </div>
      <div class="subsection">
        <a name="command" />
        <h5>Command line summary</h5>
        <textarea id="cmd" rows="5" style="width:100%;" readonly="readonly">
        </textarea>
        <script>$("cmd").value = data["cmd"].join(" ");</script>
      </div>
    </div>
  </body>
</html>
